After installation of passport and attempting to send my valid username and password so as to receive an access_token via /oauth/token Passport returned something like this
access_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSU1..."
expires_in: 31536000
refresh_token: "def5020062786ebc02511724eeba97..."
token_type: "Bearer"
the expires_in evaluates to _Friday, January 1, 1971 12:00:00 AM_.
I thought expires_in should be sometime => after now(), something like
Carbon::now()->addDays(15), maybe 1500743830
I don't know what I'm doing wrong
php: 7.0
ubuntu: 17.04
laravel/passport: ^3.0,
Hi, @Adesubomi.
I think expires_in means that the token will expire in how many seconds.
So 31536000 (365 days, 0 hours, 0 minutes and 0 seconds) which means that this token will expire in 1 year.
If you want get exact date, I think you need add it with value of column created_time.
@Adesubomi please see @SmileYuhao's answer which is correct
Answers my question. Apparently, Laravel Passport DOES NOT return wrong expires_in
Thank you for your time.
how do we make it return date time?
Most helpful comment
Hi, @Adesubomi.
I think
expires_inmeans that the token will expire in how many seconds.So
31536000(365 days, 0 hours, 0 minutes and 0 seconds) which means that this token will expire in 1 year.If you want get exact date, I think you need add it with value of column
created_time.