Skip to content
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

next_link not used in flask.Auth.login #27

Closed
runxiyu opened this issue May 21, 2024 · 0 comments · Fixed by #28
Closed

next_link not used in flask.Auth.login #27

runxiyu opened this issue May 21, 2024 · 0 comments · Fixed by #28

Comments

@runxiyu
Copy link

runxiyu commented May 21, 2024

(This issue is based on what's in commit 341420da9adc02e498b8bf55fa319d5c091593ff)

flask.Auth.login_required (which the documentation recommends me to use) calls flask.Auth.login with a seemingly correct next_link attribute:

    def login(self, *, next_link: str=None, scopes: List[str]=None):
        ...
            return self.login(
                next_link=request.path,  # https://flask.palletsprojects.com/en/3.0.x/api/#flask.Request.path
                scopes=scopes,
                )

But flask.Auth.login never uses next_link where it probably should:

        log_in_result = self._auth.log_in(
            scopes=scopes,  # Have user consent to scopes (if any) during log-in
            redirect_uri=self._redirect_uri,
            prompt="select_account",  # Optional. More values defined in  https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
            )

It seems that adding next_link=next_link as a parameter works.

        log_in_result = self._auth.log_in(
            scopes=scopes,  # Have user consent to scopes (if any) during log-in
            redirect_uri=self._redirect_uri,
            next_link=next_link,
            prompt="select_account",  # Optional. More values defined in  https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
            )

Apologies on how I am quite unfamiliar with GitHub issues. I've read that there's a predefined way to quote and link lines but I don't seem to know how to get that to work.

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 a pull request may close this issue.

1 participant