fix: oauth 2.0 authentication type is breaking (#3531)

This commit is contained in:
Akash K
2023-11-14 00:12:04 +05:30
committed by GitHub
parent de725337d6
commit e24d0ce605
6 changed files with 187 additions and 95 deletions

View File

@@ -43,6 +43,7 @@ import { useI18n } from "@composables/i18n"
import { useToast } from "@composables/toast"
import { tokenRequest } from "~/helpers/oauth"
import { getCombinedEnvVariables } from "~/helpers/preRequest"
import * as E from "fp-ts/Either"
const t = useI18n()
const toast = useToast()
@@ -98,7 +99,11 @@ const handleAccessTokenRequest = async () => {
clientSecret: parseTemplateString(clientSecret.value, envVars),
scope: parseTemplateString(scope.value, envVars),
}
await tokenRequest(tokenReqParams)
const res = await tokenRequest(tokenReqParams)
if (res && E.isLeft(res)) {
toast.error(res.left)
}
} catch (e) {
toast.error(`${e}`)
}