(c *context.Context)
| 472 | } |
| 473 | |
| 474 | func SettingsTwoFactorRecoveryCodes(c *context.Context) { |
| 475 | if !database.Handle.TwoFactors().IsEnabled(c.Req.Context(), c.User.ID) { |
| 476 | c.NotFound() |
| 477 | return |
| 478 | } |
| 479 | |
| 480 | c.Title("settings.two_factor_recovery_codes_title") |
| 481 | c.PageIs("SettingsSecurity") |
| 482 | |
| 483 | recoveryCodes, err := database.GetRecoveryCodesByUserID(c.UserID()) |
| 484 | if err != nil { |
| 485 | c.Errorf(err, "get recovery codes by user ID") |
| 486 | return |
| 487 | } |
| 488 | c.Data["RecoveryCodes"] = recoveryCodes |
| 489 | |
| 490 | c.Success(tmplUserSettingsTwoFactorRecoveryCodes) |
| 491 | } |
| 492 | |
| 493 | func SettingsTwoFactorRecoveryCodesPost(c *context.Context) { |
| 494 | if !database.Handle.TwoFactors().IsEnabled(c.Req.Context(), c.User.ID) { |
nothing calls this directly
no test coverage detected