Passport: Laravel Passport returns wrong expires_in

Created on 7 Jul 2017  路  4Comments  路  Source: laravel/passport

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,

Most helpful comment

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.

All 4 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mehrancodes picture mehrancodes  路  3Comments

cookiejarblush picture cookiejarblush  路  4Comments

s4uron picture s4uron  路  3Comments

soubhikchatterjee picture soubhikchatterjee  路  4Comments

SwiTool picture SwiTool  路  3Comments