Sunday, April 2, 2017

Sending more data with Laravel passport oauth/token

So, I'm using Laravel+Passport and so far is working fine.

But, I would like to made a small change to the passport code(well, not in the vendor folder, I hope), once that I would request the User to change it's password in case that he is doing the first login.

So, what I would need is two things (I believe):

1 - How can I add one more info to the oauth/token response? Together with the access_token, I would like to add one column from the DB that is needsNewPassword=true/false.

2 - In case that needsNewPassword is true, then, the app will redirect to another screen, where the user will set a new password. I would set the new password, remove the flag for needsNewPassword and send back a new access_token to the user. The user then, would use only that access_token. How can I regenerate a new access_token?

Thanks for you help! João



via user3069929

Advertisement