- Notifications
You must be signed in to change notification settings - Fork1k
feat: keep original token refresh error in external auth#19339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE external_auth_links | ||
DROP COLUMN oauth_refresh_failure_reason | ||
; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ALTER TABLE external_auth_links | ||
ADD COLUMN oauth_refresh_failure_reason TEXT NOT NULL DEFAULT '' | ||
; | ||
COMMENT ON COLUMN external_auth_links.oauth_refresh_failure_reason IS | ||
'This error means the refresh token is invalid. Cached so we can avoid calling the external provider again for the same error.' | ||
; |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -40,13 +40,20 @@ UPDATE external_auth_links SET | ||
oauth_refresh_token = $6, | ||
oauth_refresh_token_key_id = $7, | ||
oauth_expiry = $8, | ||
oauth_extra = $9, | ||
Emyrk marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
-- Only 'UpdateExternalAuthLinkRefreshToken' supports updating the oauth_refresh_failure_reason. | ||
-- Any updates to the external auth link, will be assumed to change the state and clear | ||
-- any cached errors. | ||
oauth_refresh_failure_reason = '' | ||
WHERE provider_id = $1 AND user_id = $2 RETURNING *; | ||
-- name: UpdateExternalAuthLinkRefreshToken :exec | ||
UPDATE | ||
external_auth_links | ||
SET | ||
-- oauth_refresh_failure_reason can be set to cache the failure reason | ||
-- for subsequent refresh attempts. | ||
oauth_refresh_failure_reason = @oauth_refresh_failure_reason, | ||
oauth_refresh_token = @oauth_refresh_token, | ||
updated_at = @updated_at | ||
WHERE | ||
Uh oh!
There was an error while loading.Please reload this page.