This commit is contained in:
parent
8f8d0e095f
commit
c4951ed359
|
@ -23,6 +23,7 @@ type OIDCHandler struct {
|
|||
oidc *oidcservice.OIDCService
|
||||
user *userservice.UserService
|
||||
uiHost string
|
||||
prod bool
|
||||
}
|
||||
|
||||
func NewOIDCHandler(cfg *config.Config, oidc *oidcservice.OIDCService, user *userservice.UserService) *OIDCHandler {
|
||||
|
@ -32,6 +33,7 @@ func NewOIDCHandler(cfg *config.Config, oidc *oidcservice.OIDCService, user *use
|
|||
oidc: oidc,
|
||||
user: user,
|
||||
uiHost: uiHost,
|
||||
prod: cfg.Prod,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,5 +128,11 @@ func (h *OIDCHandler) Callback(w http.ResponseWriter, r *http.Request) {
|
|||
Host: h.uiHost,
|
||||
Path: "/",
|
||||
}
|
||||
http.Redirect(w, r, uiURL.String(), http.StatusFound)
|
||||
|
||||
redirectURL := "/"
|
||||
if !h.prod {
|
||||
redirectURL = uiURL.String()
|
||||
}
|
||||
|
||||
http.Redirect(w, r, redirectURL, http.StatusFound)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user