feat: ability to refresh tokens for oauth flows (#4302)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
@@ -255,7 +255,7 @@ onMounted(() => {
|
||||
return
|
||||
}
|
||||
|
||||
const { context, source, token }: PersistedOAuthConfig =
|
||||
const { context, source, token, refresh_token }: PersistedOAuthConfig =
|
||||
JSON.parse(localOAuthTempConfig)
|
||||
|
||||
if (source === "REST") {
|
||||
@@ -279,6 +279,10 @@ onMounted(() => {
|
||||
const grantTypeInfo = auth.grantTypeInfo
|
||||
|
||||
grantTypeInfo && (grantTypeInfo.token = token ?? "")
|
||||
|
||||
if (refresh_token && grantTypeInfo.grantType === "AUTHORIZATION_CODE") {
|
||||
grantTypeInfo.refreshToken = refresh_token
|
||||
}
|
||||
}
|
||||
|
||||
editingProperties.value = unsavedCollectionProperties
|
||||
|
||||
@@ -428,7 +428,7 @@ onMounted(() => {
|
||||
return
|
||||
}
|
||||
|
||||
const { context, source, token }: PersistedOAuthConfig =
|
||||
const { context, source, token, refresh_token }: PersistedOAuthConfig =
|
||||
JSON.parse(localOAuthTempConfig)
|
||||
|
||||
if (source === "GraphQL") {
|
||||
@@ -452,6 +452,10 @@ onMounted(() => {
|
||||
const grantTypeInfo = auth.grantTypeInfo
|
||||
|
||||
grantTypeInfo && (grantTypeInfo.token = token ?? "")
|
||||
|
||||
if (refresh_token && grantTypeInfo.grantType === "AUTHORIZATION_CODE") {
|
||||
grantTypeInfo.refreshToken = refresh_token
|
||||
}
|
||||
}
|
||||
|
||||
editingProperties.value = unsavedCollectionProperties
|
||||
|
||||
Reference in New Issue
Block a user