feat: ability to refresh tokens for oauth flows (#4302)

Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
Akash K
2024-08-29 13:27:31 +05:30
committed by GitHub
parent 2ed7221182
commit 181ad098e0
20 changed files with 488 additions and 68 deletions

View File

@@ -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"))
}