Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'JWT' not found when creating a manual token #25

Open
zeusent opened this issue Apr 4, 2016 · 1 comment
Open

Class 'JWT' not found when creating a manual token #25

zeusent opened this issue Apr 4, 2016 · 1 comment

Comments

@zeusent
Copy link

zeusent commented Apr 4, 2016

When I try to create a manual token I get the following error:

Whoops, looks like something went wrong.

FatalErrorException in Token.php line 42:
Class 'JWT' not found

1. in Token.php line 42
2. at FatalErrorException->__construct() in HandleExceptions.php line 133
3. at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 118
4. at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
5. at Token->create() in routes.php line 29
6. at RouteServiceProvider->{closure:/usr/share/nginx/html/app/Http/routes.php:16-31}() in Route.php line 158
7. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php:158}() in Route.php line 158
8. at Route->runCallable() in Route.php line 137
9. at Route->run() in Router.php line 724
10. at Router->Illuminate\Routing\{closure}() in Pipeline.php line 52
11. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:52}() in Pipeline.php line 52
12. at Pipeline->Illuminate\Routing\{closure}() in VerifyCsrfToken.php line 64
13. at VerifyCsrfToken->handle() in Pipeline.php line 124
14. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
15. at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
16. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:32}() in Pipeline.php line 32
17. at Pipeline->Illuminate\Routing\{closure}() in ShareErrorsFromSession.php line 49
18. at ShareErrorsFromSession->handle() in Pipeline.php line 124
19. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
20. at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
21. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:32}() in Pipeline.php line 32
22. at Pipeline->Illuminate\Routing\{closure}() in StartSession.php line 62
23. at StartSession->handle() in Pipeline.php line 124
24. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
25. at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
26. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:32}() in Pipeline.php line 32
27. at Pipeline->Illuminate\Routing\{closure}() in AddQueuedCookiesToResponse.php line 37
28. at AddQueuedCookiesToResponse->handle() in Pipeline.php line 124
29. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
30. at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
31. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:32}() in Pipeline.php line 32
32. at Pipeline->Illuminate\Routing\{closure}() in EncryptCookies.php line 59
33. at EncryptCookies->handle() in Pipeline.php line 124
34. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
35. at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
36. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:32}() in Pipeline.php line 32
37. at Pipeline->Illuminate\Routing\{closure}() in Pipeline.php line 103
38. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
39. at Pipeline->then() in Router.php line 726
40. at Router->runRouteWithinStack() in Router.php line 699
41. at Router->dispatchToRoute() in Router.php line 675
42. at Router->dispatch() in Kernel.php line 246
43. at Kernel->Illuminate\Foundation\Http\{closure}() in Pipeline.php line 52
44. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:52}() in Pipeline.php line 52
45. at Pipeline->Illuminate\Routing\{closure}() in CheckForMaintenanceMode.php line 44
46. at CheckForMaintenanceMode->handle() in Pipeline.php line 124
47. at call_user_func_array:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
48. at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
49. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:32}() in Pipeline.php line 32
50. at Pipeline->Illuminate\Routing\{closure}() in Pipeline.php line 103
51. at call_user_func:{/usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
52. at Pipeline->then() in Kernel.php line 132
53. at Kernel->sendRequestThroughRouter() in Kernel.php line 99
54. at Kernel->handle() in index.php line 54
55. at {main}() in index.php line 0

Here's my code for it:

$FirebaseTokenGenerator = new J42\LaravelFirebase\Token('H283KdeEyw8xH0O9wgKCuxnlfLCTZCBKfOKArBjY');
$Firebase = App::make('firebase');
$token = $FirebaseTokenGenerator->create([], []);
$Firebase->setToken($token);
@boyanov
Copy link

boyanov commented May 31, 2016

To solve similar issue I had to modify the file Token.php line 42 like this:
return \Firebase\JWT\JWT::encode($claims, $this->secret, 'HS256');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants