feat: my user mfas (#264)

This commit is contained in:
Fabi
2020-06-24 10:47:11 +02:00
committed by GitHub
parent e54778828e
commit f7aed1c864
4 changed files with 36 additions and 3 deletions

View File

@@ -170,6 +170,10 @@ func (repo *UserRepo) ChangePassword(ctx context.Context, userID, old, new strin
return err
}
func (repo *UserRepo) MyUserMfas(ctx context.Context) ([]*model.MultiFactor, error) {
return repo.View.UserMfas(auth.GetCtxData(ctx).UserID)
}
func (repo *UserRepo) AddMfaOTP(ctx context.Context, userID string) (*model.OTP, error) {
return repo.UserEvents.AddOTP(ctx, userID)
}

View File

@@ -49,6 +49,7 @@ type myUserRepo interface {
ChangeMyPassword(ctx context.Context, old, new string) error
MyUserMfas(ctx context.Context) ([]*model.MultiFactor, error)
AddMyMfaOTP(ctx context.Context) (*model.OTP, error)
VerifyMyMfaOTPSetup(ctx context.Context, code string) error
RemoveMyMfaOTP(ctx context.Context) error