chore: use time constant
for further configurable settings
This commit is contained in:
parent
24efbe8127
commit
177ae35699
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue