gitea/routers/web/auth
Sybren 95e8ea9440
Allow setting `redirect_to` cookie on OAuth login (#22594)
The regular login flow can use a `redirect_to` cookie to ensure the user
ends their authentication flow on the same page as where they started
it.

This commit adds the same functionality to the OAuth login URLs, so that
you can use URLs like these to directly use a specific OAuth provider:

`/user/oauth2/{provider}?redirect_to={post-login path}`

Only the `auth.SignInOAuth()` function needed a change for this, as the
rest of the login flow is aware of this cookie and uses it properly
already.
2023-01-24 11:41:38 -05:00
..
2fa.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
auth.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
linkaccount.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
main_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
oauth.go Allow setting `redirect_to` cookie on OAuth login (#22594) 2023-01-24 11:41:38 -05:00
oauth_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
openid.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
password.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
webauthn.go Replace deprecated Webauthn library (#22400) 2023-01-11 21:51:00 -05:00