(c *context.Context)
| 388 | } |
| 389 | |
| 390 | func 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 | |
| 404 | func SettingsTwoFactorEnable(c *context.Context) { |
| 405 | if database.Handle.TwoFactors().IsEnabled(c.Req.Context(), c.User.ID) { |
nothing calls this directly
no test coverage detected