馃 How to return user data along with the token in /auth/callback
JWT + Bearer?
#1381
-
Hi 馃憢馃徎 First of all, Thanks for this amazing package. This is super useful and I'm trying to make contribution as I can. I've question while implementing the OAuth only full stack app that use SSR app (NuxtJS) on frontend and FastAPI User on backend. I've implmented google auth and it's doing great except after successful API call to Thanks 馃 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The thing is, the OAuth callback route is designed to return the response generated by the authentication backend's So, if you really want to do this, you would need to reimplement the fastapi-users/fastapi_users/router/oauth.py Line 101 in 61dba26 |
Beta Was this translation helpful? Give feedback.
The thing is, the OAuth callback route is designed to return the response generated by the authentication backend's
Transport
, by calling theget_login_response
method. Problem is this method only receives the token, not the user.So, if you really want to do this, you would need to reimplement the
callback
endpoint to fit it to your needs:fastapi-users/fastapi_users/router/oauth.py
Line 101 in 61dba26