auth path / verification only

This commit is contained in:
Ota Prokopec 2023-03-13 17:26:32 +01:00
parent 37755eeac9
commit 4eafb2f123
4 changed files with 28 additions and 37 deletions

View File

@ -1,15 +1,13 @@
module.exports = { module.exports = {
env: { env: {
browser: true, browser: true,
es2021: true es2021: true,
}, },
extends: 'standard-with-typescript', extends: 'standard-with-typescript',
overrides: [ overrides: [],
],
parserOptions: { parserOptions: {
ecmaVersion: 'latest', ecmaVersion: 'latest',
sourceType: 'module' sourceType: 'module',
}, },
rules: { rules: {},
}
} }

View File

@ -12,7 +12,7 @@
let isMounted = false let isMounted = false
$: isReady = $localeLoading === false && $authLoading === false && isMounted $: isReady = $localeLoading === false && $authLoading === false && isMounted
$: if (isReady && !$user) { $: if (isReady && $user?.emailVerification) {
console.log('change') console.log('change')
if (!location.pathname.startsWith('/login') && !location.pathname.startsWith('/register')) { if (!location.pathname.startsWith('/login') && !location.pathname.startsWith('/register')) {

View File

@ -7,19 +7,12 @@
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"paths": { "paths": {
"$lib/*": [ "$lib/*": ["./src/lib/*"],
"./src/lib/*" "$root/*": ["./*"],
], "$src/*": ["./src/*"],
"$root/*": [ "$routes/*": ["./src/routes/*"]
"./*" }
],
"$src/*": [
"./src/*"
],
"$routes/*": [
"./src/routes/*"
],
},
} }
} }

View File

@ -1,24 +1,24 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte' import { svelte } from '@sveltejs/vite-plugin-svelte'
import preprocess from "svelte-preprocess" import preprocess from 'svelte-preprocess'
import path from 'path' import path from 'path'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
resolve: { resolve: {
alias: { alias: {
'$lib': path.resolve(__dirname, 'src', 'lib'), $lib: path.resolve(__dirname, 'src', 'lib'),
'$root': path.resolve(__dirname), $root: path.resolve(__dirname),
'$src': path.resolve(__dirname, 'src'), $src: path.resolve(__dirname, 'src'),
'$routes': path.resolve(__dirname, 'src', 'routes') $routes: path.resolve(__dirname, 'src', 'routes'),
} },
}, },
plugins: [ plugins: [
svelte({ svelte({
preprocess: preprocess({ preprocess: preprocess({
scss: true, scss: true,
postcss: true postcss: true,
}) }),
}) }),
] ],
}) })