mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 16:06:08 +00:00
21 lines
432 B
Go
21 lines
432 B
Go
package jobs
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/warmbly/warmbly/internal/models"
|
|
)
|
|
|
|
func (s *JobsService) HandleTokenUpdate(ctx context.Context, e *models.JobEventTokenUpdate) error {
|
|
if e.SealedTokens != "" {
|
|
return s.EmailRepository.RefreshBoxTokenSealed(ctx, e.EmailID, e.SealedTokens, e.ExpiresAt)
|
|
}
|
|
return s.EmailRepository.RefreshWorkerBoxToken(
|
|
ctx,
|
|
e.EmailID,
|
|
e.AccessToken,
|
|
e.RefreshToken,
|
|
e.ExpiresAt,
|
|
)
|
|
}
|