Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

maxdorninger
Copy link

Add a feature to the CookieTransport class to redirect to a specific URL after login. This is useful because currently, a user won't be redirected after logging in via OAuth and will be stuck on the OAuth server's "redirecting"/"successfully logged in" page.

The current fix for this issue is to create another CookieTransport class and overwrite the get_login_response function like this:

class RedirectingCookieTransport(CookieTransport):
    async def get_login_response(self, token: str) -> Response:
        response = RedirectResponse(redirect_url, status_code=status.HTTP_302_FOUND)
        return self._set_login_cookie(response, token)

Though I think that this should just be a feature of the library.

Add attribute to the CookeTransport class to redirect to a specific url after login.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant