satellite/console: Add missing monkit calls
Add monkit monitoring calls to a couple of the service's methods because they were missed. Change-Id: I327a79634b7cdcaeb0e2701a737bb714a6478c4a
This commit is contained in:
parent
ac241501ca
commit
7299e9f92e
@ -527,7 +527,6 @@ func (payment Payments) TokenDeposit(ctx context.Context, amount int64) (_ *paym
|
|||||||
}
|
}
|
||||||
|
|
||||||
tx, err := payment.service.accounts.StorjTokens().Deposit(ctx, user.ID, amount)
|
tx, err := payment.service.accounts.StorjTokens().Deposit(ctx, user.ID, amount)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, Error.Wrap(err)
|
return nil, Error.Wrap(err)
|
||||||
}
|
}
|
||||||
@ -797,7 +796,9 @@ func (s *Service) GeneratePasswordRecoveryToken(ctx context.Context, id uuid.UUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GenerateSessionToken creates a new session and returns the string representation of its token.
|
// GenerateSessionToken creates a new session and returns the string representation of its token.
|
||||||
func (s *Service) GenerateSessionToken(ctx context.Context, userID uuid.UUID, email, ip, userAgent string) (consoleauth.Token, error) {
|
func (s *Service) GenerateSessionToken(ctx context.Context, userID uuid.UUID, email, ip, userAgent string) (_ consoleauth.Token, err error) {
|
||||||
|
defer mon.Task()(&ctx)(&err)
|
||||||
|
|
||||||
sessionID, err := uuid.New()
|
sessionID, err := uuid.New()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return consoleauth.Token{}, Error.Wrap(err)
|
return consoleauth.Token{}, Error.Wrap(err)
|
||||||
@ -1129,7 +1130,9 @@ func (s *Service) Token(ctx context.Context, request AuthUser) (token consoleaut
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UpdateUsersFailedLoginState updates User's failed login state.
|
// UpdateUsersFailedLoginState updates User's failed login state.
|
||||||
func (s *Service) UpdateUsersFailedLoginState(ctx context.Context, user *User) error {
|
func (s *Service) UpdateUsersFailedLoginState(ctx context.Context, user *User) (err error) {
|
||||||
|
defer mon.Task()(&ctx)(&err)
|
||||||
|
|
||||||
updateRequest := UpdateUserRequest{}
|
updateRequest := UpdateUserRequest{}
|
||||||
if user.FailedLoginCount >= s.config.LoginAttemptsWithoutPenalty-1 {
|
if user.FailedLoginCount >= s.config.LoginAttemptsWithoutPenalty-1 {
|
||||||
lockoutDuration := time.Duration(math.Pow(s.config.FailedLoginPenalty, float64(user.FailedLoginCount-1))) * time.Minute
|
lockoutDuration := time.Duration(math.Pow(s.config.FailedLoginPenalty, float64(user.FailedLoginCount-1))) * time.Minute
|
||||||
|
Loading…
Reference in New Issue
Block a user