Properly handle cb errors
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-04-25 18:28:45 +02:00
parent 2cca64f9b8
commit 38e7c96d20
2 changed files with 33 additions and 7 deletions

View File

@@ -32,6 +32,12 @@ pub enum Action<'a> {
provider_id: &'a ProviderID,
state: &'a str,
},
ProviderError {
message: &'a str,
},
ProviderCBInvalidState {
state: &'a str,
},
Signout,
UserNeed2FAOnLogin(&'a User),
UserSuccessfullyAuthenticated(&'a User),
@@ -98,6 +104,10 @@ impl<'a> Action<'a> {
Action::StartLoginAttemptWithOpenIDProvider { provider_id, state } => format!(
"started new authentication attempt through an OpenID provider (prov={} / state={state})", provider_id.0
),
Action::ProviderError { message } =>
format!("failed provider authentication with message '{message}'"),
Action::ProviderCBInvalidState { state } =>
format!("provided invalid callback state after provider authentication: '{state}'"),
Action::Signout => "signed out".to_string(),
Action::UserNeed2FAOnLogin(user) => {
format!(