UPDATE OAuth2 user service to handle user creation and redirect after login

This commit is contained in:
2025-06-24 14:21:59 +02:00
parent df7c2a15df
commit 0237ec57db
8 changed files with 84 additions and 13 deletions

View File

@@ -9,13 +9,18 @@ type props = {
}
const Topbar = ({sidebarToggled, setSidebarToggled, className}: props) => {
const apiUrl = import.meta.env.VITE_API_URL;
const redirectUri = encodeURIComponent(window.location.href);
const loginUrl = `${apiUrl}/oauth2/authorization/google?redirect_uri=${redirectUri}`;
return (
<div className={clsx(className, "flex justify-between")}>
<MenuButton onClick={() => setSidebarToggled(!sidebarToggled)}>
{sidebarToggled ? <Menu size={24}/> : <X size={24}/>}
</MenuButton>
<MenuButton className={"w-20 text-gray-600"}>
<MenuButton className={"w-20 text-gray-600"}
onClick={() => globalThis.location.href = loginUrl}>
Login
</MenuButton>
</div>