Merge pull request 'feat: migrate TOTP secrets to keying' (#6074) from gusted/forgejo-totp-keying into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6074
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-11-27 18:31:35 +00:00
commit 22d08c62f1
18 changed files with 149 additions and 47 deletions

View file

@ -38,9 +38,8 @@ func TestAPITwoFactor(t *testing.T) {
tfa := &auth_model.TwoFactor{
UID: user.ID,
}
require.NoError(t, tfa.SetSecret(otpKey.Secret()))
require.NoError(t, auth_model.NewTwoFactor(db.DefaultContext, tfa))
require.NoError(t, auth_model.NewTwoFactor(db.DefaultContext, tfa, otpKey.Secret()))
req = NewRequest(t, "GET", "/api/v1/user").
AddBasicAuth(user.Name)