feat: ability to refresh tokens for oauth flows (#4302)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
@@ -97,6 +97,11 @@ onMounted(async () => {
|
||||
...persistedOAuthConfig,
|
||||
token: tokenInfo.right.access_token,
|
||||
}
|
||||
|
||||
if (tokenInfo.right.refresh_token) {
|
||||
authConfig.refresh_token = tokenInfo.right.refresh_token
|
||||
}
|
||||
|
||||
persistenceService.setLocalConfig(
|
||||
"oauth_temp_config",
|
||||
JSON.stringify(authConfig)
|
||||
@@ -118,6 +123,14 @@ onMounted(async () => {
|
||||
tabService.currentActiveTab.value.document.request.auth.grantTypeInfo.token =
|
||||
tokenInfo.right.access_token
|
||||
|
||||
if (
|
||||
tabService.currentActiveTab.value.document.request.auth.grantTypeInfo
|
||||
.grantType === "AUTHORIZATION_CODE"
|
||||
) {
|
||||
tabService.currentActiveTab.value.document.request.auth.grantTypeInfo.refreshToken =
|
||||
tokenInfo.right.refresh_token
|
||||
}
|
||||
|
||||
toast.success(t("authorization.oauth.token_fetched_successfully"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user