mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-04-21 12:32:38 +00:00
allow to store temporary sessions within the data provider
so we can persist password reset codes, OIDC auth sessions and tokens. These features will also work in multi-node setups without sicky sessions now Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ func (c *Config) Initialize() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetAvailableTOTPConfigs returns the available TOTP config names
|
||||
// GetAvailableTOTPConfigs returns the available TOTP configs
|
||||
func GetAvailableTOTPConfigs() []*TOTPConfig {
|
||||
return totpConfigs
|
||||
}
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ func (c *TOTPConfig) generate(username string, qrCodeWidth, qrCodeHeight int) (s
|
||||
}
|
||||
|
||||
func cleanupUsedPasscodes() {
|
||||
usedPasscodes.Range(func(key, value interface{}) bool {
|
||||
usedPasscodes.Range(func(key, value any) bool {
|
||||
exp, ok := value.(time.Time)
|
||||
if !ok || exp.Before(time.Now().UTC()) {
|
||||
usedPasscodes.Delete(key)
|
||||
|
||||
Reference in New Issue
Block a user