Hoi, welkom op deze pagina!
-diff --git a/app/auth/mutations/login.ts b/app/auth/mutations/login.ts index 816eba4..84c9b20 100644 --- a/app/auth/mutations/login.ts +++ b/app/auth/mutations/login.ts @@ -1,7 +1,7 @@ import { SessionContext } from "blitz" import { authenticateUser } from "app/auth/auth-utils" import { LoginInput, LoginInputType } from "../validations" - +export let LogIn = false export default async function login(input: LoginInputType, ctx: { session?: SessionContext } = {}) { // This throws an error if input is invalid const { email, password } = LoginInput.parse(input) @@ -10,6 +10,6 @@ export default async function login(input: LoginInputType, ctx: { session?: Sess const user = await authenticateUser(email, password) await ctx.session!.create({ userId: user.id, roles: [user.role] }) - + LogIn = true return user } diff --git a/app/auth/mutations/logout.ts b/app/auth/mutations/logout.ts index 0103916..b2ca600 100644 --- a/app/auth/mutations/logout.ts +++ b/app/auth/mutations/logout.ts @@ -1,5 +1,4 @@ import { SessionContext } from "blitz" - export default async function logout(_ = null, ctx: { session?: SessionContext } = {}) { return await ctx.session!.revoke() } diff --git a/app/hooks/useCurrentUser.ts b/app/hooks/useCurrentUser.ts index 47ebaf5..3395b41 100644 --- a/app/hooks/useCurrentUser.ts +++ b/app/hooks/useCurrentUser.ts @@ -1,6 +1,5 @@ import { useQuery, useSession } from "blitz" import getCurrentUser from "app/users/queries/getCurrentUser" - export const useCurrentUser = () => { // We wouldn't have to useSession() here, but doing so improves perf on initial // load since we can skip the getCurrentUser() request. diff --git a/app/layouts/style.css b/app/layouts/style.css deleted file mode 100644 index e69de29..0000000 diff --git a/app/pages/Fietsen.tsx b/app/pages/Fietsen.tsx deleted file mode 100644 index 8ccd166..0000000 --- a/app/pages/Fietsen.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React, { Suspense } from "react" -import Layout from "app/layouts/Layout" -import { Head, Link, usePaginatedQuery, useRouter, BlitzPage } from "blitz" - -const ITEMS_PER_PAGE = 100 -const FietsenPage: BlitzPage = () => { - return ( -
Hoi, welkom op deze pagina!
-{currentUser.id}
- {currentUser.role}
+
+ Hallo {currentUser.email}!, Welkom op de site! Uw UserID is:
+ {currentUser.id}
. Uw UserRole is: {currentUser.role}
+
Hoi, welkom op deze pagina!
- - Klik Deze Link! -