Added error logging to account activation handler (#1647)
This commit is contained in:
parent
a3caa8e00d
commit
2218793c55
@ -78,11 +78,19 @@ func rootMutation(log *zap.Logger, service *console.Service, mailService *mailse
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Error("register: failed to parse secret",
|
||||
zap.String("rawSecret", secretInput),
|
||||
zap.Error(err))
|
||||
|
||||
user, err := service.CreateUser(p.Context, createUser, secret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Error("register: failed to create account",
|
||||
zap.String("rawSecret", secretInput),
|
||||
zap.Error(err))
|
||||
|
||||
token, err := service.GenerateActivationToken(p.Context, user.ID, user.Email)
|
||||
if err != nil {
|
||||
log.Error("register: failed to generate activation token",
|
||||
|
@ -152,6 +152,10 @@ func (s *Server) accountActivationHandler(w http.ResponseWriter, req *http.Reque
|
||||
|
||||
err := s.service.ActivateAccount(context.Background(), activationToken)
|
||||
if err != nil {
|
||||
s.log.Error("activation: failed to activate account",
|
||||
zap.String("token", activationToken),
|
||||
zap.Error(err))
|
||||
|
||||
http.ServeFile(w, req, filepath.Join(s.config.StaticDir, "static", "errors", "404.html"))
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user