Skip to content
Snippets Groups Projects
Commit 92573bc6 authored by thijsheijden's avatar thijsheijden
Browse files

fix(api): moved user info fetch to correct place

parent 610c0ecb
Branches fix/sharelink
No related tags found
1 merge request!13merge develop into main
......@@ -16,8 +16,12 @@ import { GetUserInfo } from '@graphpolaris/shared/data-access/api';
function useIsAuthorized() {
const [userAuthorized, setUserAuthorized] = useState(false);
const authCallback = () => {
const authCallback = async () => {
setUserAuthorized(true);
// Print the user that is currently logged in
const user = await GetUserInfo();
console.log(user);
};
AuthorizationHandler.instance().setCallback(authCallback);
......@@ -26,12 +30,6 @@ function useIsAuthorized() {
const authorize = async () => {
const authorized = await AuthorizationHandler.instance().Authorize();
setUserAuthorized(authorized);
if (authorized) {
// Print the user that is currently logged in
const user = await GetUserInfo();
console.log(user);
}
};
useEffect(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment