MCPcopy Create free account
hub / github.com/gogs/gogs / SettingsSecurity

Function SettingsSecurity

internal/route/user/setting.go:390–402  ·  view source on GitHub ↗
(c *context.Context)

Source from the content-addressed store, hash-verified

388}
389
390func SettingsSecurity(c *context.Context) {
391 c.Title("settings.security")
392 c.PageIs("SettingsSecurity")
393
394 t, err := database.Handle.TwoFactors().GetByUserID(c.Req.Context(), c.UserID())
395 if err != nil && !database.IsErrTwoFactorNotFound(err) {
396 c.Errorf(err, "get two factor by user ID")
397 return
398 }
399 c.Data["TwoFactor"] = t
400
401 c.Success(tmplUserSettingsSecurity)
402}
403
404func SettingsTwoFactorEnable(c *context.Context) {
405 if database.Handle.TwoFactors().IsEnabled(c.Req.Context(), c.User.ID) {

Callers

nothing calls this directly

Calls 8

IsErrTwoFactorNotFoundFunction · 0.92
TitleMethod · 0.80
PageIsMethod · 0.80
GetByUserIDMethod · 0.80
TwoFactorsMethod · 0.80
UserIDMethod · 0.80
SuccessMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected