Chore: add context to login (#41316)

* Chore: add context to login attempt file and tests

* Chore: add context

* Chore: add context to login and login tests

* Chore: continue adding context to login

* Chore: add context to login query
This commit is contained in:
Katarina Yang
2021-11-08 15:53:51 +01:00
committed by GitHub
parent b58cca5d51
commit c4306f9b3e
22 changed files with 90 additions and 78 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ func (o *Service) GetCurrentOAuthToken(ctx context.Context, user *models.SignedI
}
authInfoQuery := &models.GetAuthInfoQuery{UserId: user.UserId}
if err := bus.Dispatch(authInfoQuery); err != nil {
if err := bus.DispatchCtx(ctx, authInfoQuery); err != nil {
if errors.Is(err, models.ErrUserNotFound) {
// Not necessarily an error. User may be logged in another way.
logger.Debug("no OAuth token for user found", "userId", user.UserId, "username", user.Login)