fix: improvements for WebAuthN (#1105)

* add missing translations

* add missing passwordless funcs in api

* remove u2f with verification from setup in login
This commit is contained in:
Livio Amstutz
2020-12-15 16:44:16 +01:00
committed by GitHub
parent 7463bf4fe0
commit 71df1bcd0e
14 changed files with 150 additions and 11 deletions
+16
View File
@@ -436,3 +436,19 @@ func verifyWebAuthNFromModel(u2f *usr_model.WebAuthNToken) *auth.WebAuthNRespons
State: mfaStateFromModel(u2f.State),
}
}
func webAuthNTokensFromModel(tokens []*usr_model.WebAuthNToken) *auth.WebAuthNTokens {
result := make([]*auth.WebAuthNToken, len(tokens))
for i, token := range tokens {
result[i] = webAuthNTokenFromModel(token)
}
return &auth.WebAuthNTokens{Tokens: result}
}
func webAuthNTokenFromModel(token *usr_model.WebAuthNToken) *auth.WebAuthNToken {
return &auth.WebAuthNToken{
Id: token.WebAuthNTokenID,
Name: token.WebAuthNTokenName,
State: mfaStateFromModel(token.State),
}
}