mirror of
https://github.com/quexten/goldwarden.git
synced 2024-11-23 21:44:37 +03:00
Grant other sessions while pin session is active
This commit is contained in:
parent
606dd176ef
commit
9ac1d8100a
@ -86,19 +86,21 @@ func GetPermission(sessionType SessionType, ctx sockets.CallingContext, config *
|
||||
if sessionStore.verifySession(ctx, sessionType) {
|
||||
log.Info("Permission granted from cached session")
|
||||
} else {
|
||||
if biometrics.BiometricsWorking() {
|
||||
biometricsApproval := biometrics.CheckBiometrics(biometricsApprovalType)
|
||||
if !biometricsApproval {
|
||||
return false, nil
|
||||
}
|
||||
} else {
|
||||
log.Warn("Biometrics is not available, asking for pin")
|
||||
pin, err := pinentry.GetPassword("Enter PIN", "Biometrics is not available. Enter your pin to authorize this action. "+message)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if !config.VerifyPin(pin) {
|
||||
return false, nil
|
||||
if !sessionStore.verifySession(ctx, Pin) {
|
||||
if biometrics.BiometricsWorking() {
|
||||
biometricsApproval := biometrics.CheckBiometrics(biometricsApprovalType)
|
||||
if !biometricsApproval {
|
||||
return false, nil
|
||||
}
|
||||
} else {
|
||||
log.Warn("Biometrics is not available, asking for pin")
|
||||
pin, err := pinentry.GetPassword("Enter PIN", "Biometrics is not available. Enter your pin to authorize this action. "+message)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if !config.VerifyPin(pin) {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user