Update OauthCallbackPage.tsx

This commit is contained in:
Daniel Hougaard
2025-05-01 04:13:46 +04:00
parent e08c5f265e
commit 9e56790886
@@ -1,5 +1,3 @@
import crypto from "crypto";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { useNavigate, useSearch } from "@tanstack/react-router"; import { useNavigate, useSearch } from "@tanstack/react-router";
import { z } from "zod"; import { z } from "zod";
@@ -60,16 +58,9 @@ export const OAuthCallbackPage = () => {
redirectUri: state.redirectUri redirectUri: state.redirectUri
}); });
createNotification({
text: "Successfully granted Microsoft Teams admin consent",
type: "success"
});
navigate({ navigate({
to: ROUTE_PATHS.Organization.SettingsPage.path to: ROUTE_PATHS.Organization.SettingsPage.path
}); });
return;
}, []); }, []);
// Ensure that the localstorage is ready for use, to avoid the form data being malformed // Ensure that the localstorage is ready for use, to avoid the form data being malformed
@@ -85,13 +76,15 @@ export const OAuthCallbackPage = () => {
(async () => { (async () => {
try { try {
await handleMicrosoftTeams(); await handleMicrosoftTeams();
createNotification({
text: "Successfully created Microsoft Teams workflow integration",
type: "success"
});
} catch (err) { } catch (err) {
console.error(err); console.error(err);
createNotification({ createNotification({
text: text: "Failed to create Microsoft Teams workflow integration",
code !== ""
? "Failed to create Microsoft Teams workflow integration"
: "Failed to grant Microsoft Teams admin consent",
type: "error" type: "error"
}); });
} }