diff --git a/frontend/src/pages/authorize-page.tsx b/frontend/src/pages/authorize-page.tsx index eac8929..50acb02 100644 --- a/frontend/src/pages/authorize-page.tsx +++ b/frontend/src/pages/authorize-page.tsx @@ -109,10 +109,6 @@ export const AuthorizePage = () => { }, }); - if (!isLoggedIn) { - return ; - } - if (missingParams.length > 0) { return ( { ); } + if (!isLoggedIn) { + return ; + } + if (getClientInfo.isLoading) { return ( diff --git a/frontend/src/pages/login-page.tsx b/frontend/src/pages/login-page.tsx index 92a5656..f8221c7 100644 --- a/frontend/src/pages/login-page.tsx +++ b/frontend/src/pages/login-page.tsx @@ -90,7 +90,9 @@ export const LoginPage = () => { mutationKey: ["login"], onSuccess: (data) => { if (data.data.totpPending) { - window.location.replace(`/totp?${compiledOIDCParams}`); + window.location.replace( + `/totp?redirect_uri=${encodeURIComponent(props.redirect_uri)}`, + ); return; } diff --git a/internal/controller/oidc_controller.go b/internal/controller/oidc_controller.go index 1bfd932..f3fa590 100644 --- a/internal/controller/oidc_controller.go +++ b/internal/controller/oidc_controller.go @@ -233,14 +233,14 @@ func (controller *OIDCController) Token(c *gin.Context) { entry, err := controller.oidc.GetCodeEntry(c, controller.oidc.Hash(req.Code)) if err != nil { if errors.Is(err, service.ErrCodeNotFound) { - tlog.App.Warn().Str("code", req.Code).Msg("Code not found") + tlog.App.Warn().Msg("Code not found") c.JSON(400, gin.H{ "error": "invalid_grant", }) return } if errors.Is(err, service.ErrCodeExpired) { - tlog.App.Warn().Str("code", req.Code).Msg("Code expired") + tlog.App.Warn().Msg("Code expired") c.JSON(400, gin.H{ "error": "invalid_grant", })