Skip to content

feat: Add option to redirect to a specific URL after login #1517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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