-
Notifications
You must be signed in to change notification settings - Fork 785
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
Error 22007 when new access token is created #682
Comments
The problem was date formatting error in PHP < 7.2 SQL Server needs all dates to be formatted as 'Y-m-d H:i:s.v' so:
so i changed Iluminate/Database/Connection
and Doctrine\DBAL\Types\DateType
Is there more elegant way for doing this? |
I'm afraid not. I'd personally suggest to upgrade to PHP 7.2, sorry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I use Laravel 5.5 and passport 4, windows hosting, MS SQL Database.
My code went to production, after internal testing. In testing phase, this error was not thrown. 99% users on production do not see this error.
I Assume that MS SQL default date format has 3 digits representing miliseconds. Passport wants to save:
but i dont know where that extra digit came from.
It pops out only when date miliseconds are rounded, for example from 2018-04-03 17:08:51.997 to 2018-04-03 17:08:51.1000
I set :
in AppServiceProvider, but it didnt solve my problem.
I wanted to dig into framework code and find exact place where dates are formatted before saving to the databse, but without luck.
Than i found the Token Class, and i made an ugly hack:
I dont want to edit passport classes, because composer update will remove my changes.
What is the best solution in this case?
The text was updated successfully, but these errors were encountered: