fix: improvements for WebAuthN (#1105)

* add missing translations

* add missing passwordless funcs in api

* remove u2f with verification from setup in login
This commit is contained in:
Livio Amstutz
2020-12-15 16:44:16 +01:00
committed by GitHub
parent 7463bf4fe0
commit 71df1bcd0e
14 changed files with 150 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ package auth
import (
"context"
"github.com/golang/protobuf/ptypes/empty"
"github.com/caos/zitadel/pkg/grpc/auth"
@@ -175,6 +176,14 @@ func (s *Server) RemoveMyMfaU2F(ctx context.Context, id *auth.WebAuthNTokenID) (
return &empty.Empty{}, err
}
func (s *Server) GetMyPasswordless(ctx context.Context, _ *empty.Empty) (_ *auth.WebAuthNTokens, err error) {
tokens, err := s.repo.GetMyPasswordless(ctx)
if err != nil {
return nil, err
}
return webAuthNTokensFromModel(tokens), err
}
func (s *Server) AddMyPasswordless(ctx context.Context, _ *empty.Empty) (_ *auth.WebAuthNResponse, err error) {
u2f, err := s.repo.AddMyPasswordless(ctx)
return verifyWebAuthNFromModel(u2f), err