Skip to content

Commit

Permalink
Delete token cache when failed to get email
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Dec 24, 2024
1 parent bcaf972 commit 390b55b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fileserver/sync_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ func validateToken(r *http.Request, repoID string, skipCache bool) (string, *app
return email, &appError{err, "", http.StatusInternalServerError}
}
if email == "" {
tokenCache.Delete(token)
msg := fmt.Sprintf("Failed to get email by token %s", token)
return email, &appError{nil, msg, http.StatusForbidden}
}
Expand Down

0 comments on commit 390b55b

Please sign in to comment.