diff --git a/consts/time.go b/consts/time.go index f6233e9..25dbb44 100644 --- a/consts/time.go +++ b/consts/time.go @@ -6,6 +6,7 @@ const ( TIME_REQUEST_VALID = 1 * time.Hour TIME_LOGIN_REMEMBER = 10 * time.Minute + TIME_CONSENT_REMEMBER = 0 // Forever TIME_USERINFO_CACHE = 10 * time.Minute ) diff --git a/handlers/consent/consent_confirm.go b/handlers/consent/consent_confirm.go index dbced75..d93055d 100644 --- a/handlers/consent/consent_confirm.go +++ b/handlers/consent/consent_confirm.go @@ -8,6 +8,7 @@ import ( "misso/consts" "misso/global" "net/http" + "time" ) type ConsentConfirmRequest struct { @@ -79,7 +80,7 @@ func ConsentConfirm(ctx *gin.Context) { global.Logger.Debugf("User accepted the request, reporting back to hydra...") global.Logger.Debugf("Initializing ID Token...") - rememberFor := int64(0) // Remember forever + rememberFor := int64(consts.TIME_CONSENT_REMEMBER / time.Second) // Remember forever acceptReq, _, err := global.Hydra.Admin.OAuth2Api.AcceptOAuth2ConsentRequest(context.Background()).ConsentChallenge(oauth2challenge).AcceptOAuth2ConsentRequest(client.AcceptOAuth2ConsentRequest{ GrantScope: consentReq.RequestedScope, // TODO: Specify scopes GrantAccessTokenAudience: consentReq.RequestedAccessTokenAudience,