reload page after org link

This commit is contained in:
Maidul Islam
2023-07-17 17:18:55 -04:00
parent 43f4110c94
commit 216f3a0d1b
2 changed files with 6 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ const linkGitAppInstallationWithOrganization = (installationId: string, sessionI
})
}).then(async (res) => {
if (res && res.status === 200) {
return res.json();
return true
}
console.log("Failed to link installation to organization");
return undefined;

View File

@@ -18,7 +18,11 @@ export default function SecretScanning() {
const linkInstallation = async () => {
if (typeof queryParams.state === "string" && typeof queryParams.installation_id === "string"){
try {
await linkGitAppInstallationWithOrganization(queryParams.installation_id as string, queryParams.state as string)
const isLinked = await linkGitAppInstallationWithOrganization(queryParams.installation_id as string, queryParams.state as string)
if (isLinked){
router.reload()
}
console.log("installation verification complete")
}catch (e){
console.log("app installation is stale, start new session", e)