diff --git a/bun.lockb b/bun.lockb index b64753bb..e90e5a6f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index f51cbda7..b8431b57 100644 --- a/package.json +++ b/package.json @@ -1,89 +1,89 @@ { - "name": "frontend", - "version": "0.0.1", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --check . && eslint .", - "format": "prettier --write ." - }, - "devDependencies": { - "@fontsource/fira-mono": "^5.0.8", - "@neoconfetti/svelte": "^2.2.1", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "^2.5.2", - "@types/cookie": "^0.6.0", - "@types/node": "^20.11.20", - "@types/web": "^0.0.140", - "@typescript-eslint/eslint-plugin": "^7.0.1", - "@typescript-eslint/parser": "^7.0.1", - "autoprefixer": "^10.4.17", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.35.1", - "mdi-svelte": "^1.1.2", - "postcss": "^8.4.35", - "postcss-load-config": "^5.0.3", - "prettier": "^3.2.5", - "prettier-plugin-svelte": "^3.2.1", - "prettier-plugin-tailwindcss": "^0.5.11", - "sass": "^1.71.1", - "svelte": "^4.2.12", - "svelte-check": "^3.6.4", - "tailwindcss": "^3.4.1", - "tslib": "^2.6.2", - "typescript": "^5.3.3", - "vite": "^5.1.4" - }, - "type": "module", - "dependencies": { - "@hocuspocus/provider": "^2.11.2", - "@internationalized/date": "^3.5.2", - "@mdi/js": "^7.4.47", - "@tiptap-pro/extension-mathematics": "^2.7.5", - "@tiptap/core": "^2.2.4", - "@tiptap/extension-blockquote": "^2.2.4", - "@tiptap/extension-bold": "^2.2.4", - "@tiptap/extension-bullet-list": "^2.2.4", - "@tiptap/extension-code": "^2.2.4", - "@tiptap/extension-code-block": "^2.2.4", - "@tiptap/extension-collaboration": "^2.2.4", - "@tiptap/extension-collaboration-cursor": "^2.2.4", - "@tiptap/extension-color": "^2.2.4", - "@tiptap/extension-document": "^2.2.4", - "@tiptap/extension-dropcursor": "^2.2.4", - "@tiptap/extension-gapcursor": "^2.2.4", - "@tiptap/extension-hard-break": "^2.2.4", - "@tiptap/extension-heading": "^2.2.4", - "@tiptap/extension-horizontal-rule": "^2.2.4", - "@tiptap/extension-image": "^2.2.4", - "@tiptap/extension-italic": "^2.2.4", - "@tiptap/extension-list-item": "^2.2.4", - "@tiptap/extension-ordered-list": "^2.2.4", - "@tiptap/extension-paragraph": "^2.2.4", - "@tiptap/extension-placeholder": "^2.2.4", - "@tiptap/extension-strike": "^2.2.4", - "@tiptap/extension-subscript": "^2.2.4", - "@tiptap/extension-superscript": "^2.2.4", - "@tiptap/extension-task-item": "^2.2.4", - "@tiptap/extension-task-list": "^2.2.4", - "@tiptap/extension-text": "^2.2.4", - "@tiptap/extension-text-style": "^2.2.4", - "@tiptap/pm": "^2.2.4", - "akademia-authorizer-svelte": "^0.1.12", - "bits-ui": "^0.18.2", - "clsx": "^2.1.0", - "cmdk-sv": "^0.0.13", - "katex": "^0.16.9", - "lucide-svelte": "^0.334.0", - "mathlive": "^0.98.6", - "svelte-tiptap": "^1.1.2", - "tailwind-merge": "^2.2.1", - "tailwind-variants": "^0.2.0", - "tauri-plugin-window-state-api": "github:tauri-apps/tauri-plugin-window-state#v1", - "yjs": "^13.6.12" - } + "name": "frontend", + "version": "0.0.1", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@fontsource/fira-mono": "^5.0.8", + "@neoconfetti/svelte": "^2.2.1", + "@sveltejs/adapter-static": "^3.0.1", + "@sveltejs/kit": "^2.5.2", + "@types/cookie": "^0.6.0", + "@types/node": "^20.11.20", + "@types/web": "^0.0.140", + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1", + "autoprefixer": "^10.4.17", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.35.1", + "mdi-svelte": "^1.1.2", + "postcss": "^8.4.35", + "postcss-load-config": "^5.0.3", + "prettier": "^3.2.5", + "prettier-plugin-svelte": "^3.2.1", + "prettier-plugin-tailwindcss": "^0.5.11", + "sass": "^1.71.1", + "svelte": "^4.2.12", + "svelte-check": "^3.6.4", + "tailwindcss": "^3.4.1", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "vite": "^5.1.4" + }, + "type": "module", + "dependencies": { + "@hocuspocus/provider": "^2.11.2", + "@internationalized/date": "^3.5.2", + "@mdi/js": "^7.4.47", + "@tiptap-pro/extension-mathematics": "^2.7.5", + "@tiptap/core": "^2.2.4", + "@tiptap/extension-blockquote": "^2.2.4", + "@tiptap/extension-bold": "^2.2.4", + "@tiptap/extension-bullet-list": "^2.2.4", + "@tiptap/extension-code": "^2.2.4", + "@tiptap/extension-code-block": "^2.2.4", + "@tiptap/extension-collaboration": "^2.2.4", + "@tiptap/extension-collaboration-cursor": "^2.2.4", + "@tiptap/extension-color": "^2.2.4", + "@tiptap/extension-document": "^2.2.4", + "@tiptap/extension-dropcursor": "^2.2.4", + "@tiptap/extension-gapcursor": "^2.2.4", + "@tiptap/extension-hard-break": "^2.2.4", + "@tiptap/extension-heading": "^2.2.4", + "@tiptap/extension-horizontal-rule": "^2.2.4", + "@tiptap/extension-image": "^2.2.4", + "@tiptap/extension-italic": "^2.2.4", + "@tiptap/extension-list-item": "^2.2.4", + "@tiptap/extension-ordered-list": "^2.2.4", + "@tiptap/extension-paragraph": "^2.2.4", + "@tiptap/extension-placeholder": "^2.2.4", + "@tiptap/extension-strike": "^2.2.4", + "@tiptap/extension-subscript": "^2.2.4", + "@tiptap/extension-superscript": "^2.2.4", + "@tiptap/extension-task-item": "^2.2.4", + "@tiptap/extension-task-list": "^2.2.4", + "@tiptap/extension-text": "^2.2.4", + "@tiptap/extension-text-style": "^2.2.4", + "@tiptap/pm": "^2.2.4", + "bits-ui": "^0.18.2", + "clsx": "^2.1.0", + "cmdk-sv": "^0.0.13", + "katex": "^0.16.9", + "keycloak-js": "^23.0.7", + "lucide-svelte": "^0.334.0", + "mathlive": "^0.98.6", + "svelte-tiptap": "^1.1.2", + "tailwind-merge": "^2.2.1", + "tailwind-variants": "^0.2.0", + "tauri-plugin-window-state-api": "github:tauri-apps/tauri-plugin-window-state#v1", + "yjs": "^13.6.12" + } } diff --git a/src/authStore.ts b/src/authStore.ts new file mode 100644 index 00000000..1c77e4fe --- /dev/null +++ b/src/authStore.ts @@ -0,0 +1,3 @@ +import { writable } from 'svelte/store'; + +export const userInfo = writable({}); \ No newline at end of file diff --git a/src/routes/signin/+page.svelte b/src/routes/signin/+page.svelte index 3f0dc186..957875f0 100644 --- a/src/routes/signin/+page.svelte +++ b/src/routes/signin/+page.svelte @@ -1,19 +1,33 @@ @@ -24,9 +38,13 @@ Velkommen til Akademia! - Vælg en loginmetode - - + {#if loggedIn} + Du er logget ind som {$userInfo.preferred_username}! + {keycloak.logout();}}>Log ud + {:else} + Du er ikke logget ind + {keycloak.login();}}>Login + {/if}