fix: remove u2f with pin from 2fa check (#1121)

* fix: remove u2f with pin from 2fa check

* show error message on mfa init verify
This commit is contained in:
Livio Amstutz 2020-12-18 16:30:57 +01:00 committed by GitHub
parent 410a53f15b
commit e15fc0b92b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View File

@ -60,6 +60,9 @@ func (l *Login) renderMFAVerifySelected(w http.ResponseWriter, r *http.Request,
case model.MFATypeOTP: case model.MFATypeOTP:
data.MFAProviders = removeSelectedProviderFromList(verificationStep.MFAProviders, model.MFATypeOTP) data.MFAProviders = removeSelectedProviderFromList(verificationStep.MFAProviders, model.MFATypeOTP)
data.SelectedMFAProvider = model.MFATypeOTP data.SelectedMFAProvider = model.MFATypeOTP
default:
l.renderError(w, r, authReq, err)
return
} }
l.renderer.RenderTemplate(w, r, l.renderer.Templates[tmplMFAVerify], data, nil) l.renderer.RenderTemplate(w, r, l.renderer.Templates[tmplMFAVerify], data, nil)
} }

View File

@ -35,6 +35,8 @@
</div> </div>
{{end}} {{end}}
{{ template "error-message" .}}
<div class="actions"> <div class="actions">
<button class="primary" id="submit-button" type="submit">{{t "Actions.Next"}}</button> <button class="primary" id="submit-button" type="submit">{{t "Actions.Next"}}</button>
<a class="button secondary" href="{{ mfaPromptChangeUrl .AuthReqID .MFAType }}"> <a class="button secondary" href="{{ mfaPromptChangeUrl .AuthReqID .MFAType }}">

View File

@ -163,19 +163,6 @@ func (u *UserView) MFATypesAllowed(level req_model.MFALevel, policy *iam_model.L
} }
} }
//PLANNED: add sms //PLANNED: add sms
fallthrough
case req_model.MFALevelMultiFactor:
if policy.HasMultiFactors() {
for _, mfaType := range policy.MultiFactors {
switch mfaType {
case iam_model.MultiFactorTypeU2FWithPIN:
if u.IsPasswordlessReady() {
types = append(types, req_model.MFATypeU2FUserVerification)
}
}
}
}
//PLANNED: add token
} }
return types, required return types, required
} }