Add configurable invitation token validity
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -21,9 +21,10 @@ import (
|
||||
|
||||
type (
|
||||
authConfig struct {
|
||||
Cookie cookieConfig `json:"cookie"`
|
||||
Password passwordConfig `json:"password"`
|
||||
DisableSignup bool `json:"disable-signup"`
|
||||
Cookie cookieConfig `json:"cookie"`
|
||||
Password passwordConfig `json:"password"`
|
||||
DisableSignup bool `json:"disable-signup"`
|
||||
InvitationConfirmationTokenValidity int `json:"invitation-confirmation-token-validity"`
|
||||
}
|
||||
|
||||
trustAuthConfig struct {
|
||||
|
||||
@@ -99,7 +99,8 @@ func New() *Implm {
|
||||
Duration: 24,
|
||||
Domain: "localhost",
|
||||
},
|
||||
DisableSignup: false,
|
||||
DisableSignup: false,
|
||||
InvitationConfirmationTokenValidity: 3600,
|
||||
},
|
||||
TrustAuth: trustAuthConfig{
|
||||
CookieName: "TCT",
|
||||
@@ -235,6 +236,7 @@ func (impl *Implm) Run(
|
||||
impl.cfg.Auth.Cookie.Secret,
|
||||
impl.cfg.Hostname,
|
||||
impl.cfg.Auth.DisableSignup,
|
||||
time.Duration(impl.cfg.Auth.InvitationConfirmationTokenValidity)*time.Second,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create usrmgr service: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user