loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't show Link to TOTP if not set up (#27585)


authored by

JakobDev and committed by
GitHub
328da56a 1d155a43

+13 -3
+8
routers/web/auth/webauthn.go
··· 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
+5 -3
templates/user/auth/webauthn.tmpl
··· 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>