diff --git a/apps/backend/pkg/repo/repo.go b/apps/backend/pkg/repo/repo.go index 09348a26..10e43053 100644 --- a/apps/backend/pkg/repo/repo.go +++ b/apps/backend/pkg/repo/repo.go @@ -128,10 +128,11 @@ func (r *Repo) DeleteRefreshToken(ctx context.Context, refreshToken string) erro } func (r *Repo) RefreshTokenExists(ctx context.Context, refreshToken string) (bool, error) { - if _, err := orm.Auths(orm.AuthWhere.RefreshToken.EQ(null.StringFrom(refreshToken))).Exists(ctx, r.executor()); err != nil { + exists, err := orm.Auths(orm.AuthWhere.RefreshToken.EQ(null.StringFrom(refreshToken))).Exists(ctx, r.executor()) + if err != nil { return false, fmt.Errorf("refresh token exists check: %w", err) } - return true, nil + return exists, nil } type CreateUserParams struct { diff --git a/apps/web/src/jwt/jwt.ts b/apps/web/src/jwt/jwt.ts index 731ed159..432dc2f9 100644 --- a/apps/web/src/jwt/jwt.ts +++ b/apps/web/src/jwt/jwt.ts @@ -27,7 +27,7 @@ export async function RefreshAccessTokenOrLogout(): Promise { try { console.log('refreshing access token');