mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-09 11:19:04 +02:00
feat: add ability to customize session duration of clients (#1641)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ory/fosite"
|
||||
"github.com/pocket-id/pocket-id/backend/internal/model"
|
||||
"github.com/pocket-id/pocket-id/backend/internal/utils"
|
||||
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
@@ -61,6 +62,9 @@ func init() {
|
||||
"resource_uri": func(fl validator.FieldLevel) bool {
|
||||
return ValidateResourceURI(fl.Field().String())
|
||||
},
|
||||
"token_duration": func(fl validator.FieldLevel) bool {
|
||||
return model.IsValidTokenDurationMinutes(fl.Field().Int())
|
||||
},
|
||||
}
|
||||
for k, v := range validators {
|
||||
err := engine.RegisterValidation(k, v)
|
||||
|
||||
Reference in New Issue
Block a user