mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: log out and redirect user when converting to oidc (#8347)
* feat: log out user on conver to oidc Log out user and redirect to login page and log out user when they convert to oidc.
This commit is contained in:
@ -632,12 +632,18 @@ func New(options *Options) *API {
|
||||
r.Post("/login", api.postLogin)
|
||||
r.Route("/oauth2", func(r chi.Router) {
|
||||
r.Route("/github", func(r chi.Router) {
|
||||
r.Use(httpmw.ExtractOAuth2(options.GithubOAuth2Config, options.HTTPClient, nil))
|
||||
r.Use(
|
||||
httpmw.ExtractOAuth2(options.GithubOAuth2Config, options.HTTPClient, nil),
|
||||
apiKeyMiddlewareOptional,
|
||||
)
|
||||
r.Get("/callback", api.userOAuth2Github)
|
||||
})
|
||||
})
|
||||
r.Route("/oidc/callback", func(r chi.Router) {
|
||||
r.Use(httpmw.ExtractOAuth2(options.OIDCConfig, options.HTTPClient, oidcAuthURLParams))
|
||||
r.Use(
|
||||
httpmw.ExtractOAuth2(options.OIDCConfig, options.HTTPClient, oidcAuthURLParams),
|
||||
apiKeyMiddlewareOptional,
|
||||
)
|
||||
r.Get("/", api.userOIDC)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user