File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ func WebAuthn(ctx *context.Context) {
37
37
return
38
38
}
39
39
40
+ hasTwoFactor , err := auth .HasTwoFactorByUID (ctx , ctx .Session .Get ("twofaUid" ).(int64 ))
41
+ if err != nil {
42
+ ctx .ServerError ("HasTwoFactorByUID" , err )
43
+ return
44
+ }
45
+
46
+ ctx .Data ["HasTwoFactor" ] = hasTwoFactor
47
+
40
48
ctx .HTML (http .StatusOK , tplWebAuthn )
41
49
}
42
50
Original file line number Diff line number Diff line change 14
14
<div class="is-loading" style="width: 40px; height: 40px"></div>
15
15
{{ctx.Locale.Tr "webauthn_press_button"}}
16
16
</div>
17
- <div class="ui attached segment">
18
- <a href="{{AppSubUrl}}/user/two_factor">{{ctx.Locale.Tr "webauthn_use_twofa"}}</a>
19
- </div>
17
+ {{if .HasTwoFactor}}
18
+ <div class="ui attached segment">
19
+ <a href="{{AppSubUrl}}/user/two_factor">{{ctx.Locale.Tr "webauthn_use_twofa"}}</a>
20
+ </div>
21
+ {{end}}
20
22
</div>
21
23
</div>
22
24
</div>
You can’t perform that action at this time.
0 commit comments