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

Laravel Passport has error with Carbon. #1728

Closed
kindslayer opened this issue Mar 13, 2024 · 1 comment · Fixed by #1727
Closed

Laravel Passport has error with Carbon. #1728

kindslayer opened this issue Mar 13, 2024 · 1 comment · Fixed by #1727

Comments

@kindslayer
Copy link
Contributor

Laravel Version

11.0

PHP Version

8.2.16-fpm

Database Driver & Version

postgres:15.6-alpine

Description

This error happens when I use Passport's "Consuming Your API With JavaScript" feature and activate the middleware CreateFreshApiToken::class.

Error message: Carbon\Carbon::rawAddUnit(): Argument laravel/framework#3 ($value) must be of type int|float, string given, called in /var/www/vendor/nesbot/carbon/src/Carbon/Traits/Units.php on line 324

Error details: link to error details

I want to create an issue for this on GitHub.

Steps To Reproduce

  1. Install Passport: composer require laravel/passport
  2. Run Passport migrations: php artisan migrate
  3. Modify passport config in AppServiceProvider
        Passport::cookie('SPA-TOKEN');
        Passport::hashClientSecrets();
  1. Use Passport's CreateFreshApiToken middleware in web middleware group.
  2. Make new route in web.php and put this on it.
    Auth::loginUsingId(1)

In next refresh application has crash

@crynobone crynobone transferred this issue from laravel/framework Mar 14, 2024
@crynobone crynobone linked a pull request Mar 14, 2024 that will close this issue
@driesvints
Copy link
Member

Seems like a PR was sent in so let's see how it goes. Thanks

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

Successfully merging a pull request may close this issue.

2 participants