diff --git a/src/lib/Apiclient.js b/src/lib/Apiclient.js index e739e94..e2493f8 100644 --- a/src/lib/Apiclient.js +++ b/src/lib/Apiclient.js @@ -46,10 +46,9 @@ export default class Apiclient { static async login(username, password) { return ( - await axios.post(`https://kauft.es/api/auth/login`, { + await axios.post(`https://kauft.es/api/auth/login`, {}, { auth: { - username, - password + username, password } }) ).data; diff --git a/src/routes/login/index.svelte b/src/routes/login.svelte similarity index 92% rename from src/routes/login/index.svelte rename to src/routes/login.svelte index da73694..71ac261 100644 --- a/src/routes/login/index.svelte +++ b/src/routes/login.svelte @@ -5,7 +5,9 @@ import Apiclient from '$lib/Apiclient'; $: username = ""; $: password = ""; + $: error = ""; + UserStore.init(); async function login() { let login = await Apiclient.login(username, password); if (login.status != 200 && login.status != 201) { @@ -27,14 +29,13 @@ import Apiclient from '$lib/Apiclient';

Please login

-
@@ -44,7 +45,7 @@ import Apiclient from '$lib/Apiclient'; type="password" placeholder="Password" aria-label="Password" - value={password} + bind:value={password} /> @@ -56,6 +57,5 @@ import Apiclient from '$lib/Apiclient'; Login -
diff --git a/src/routes/login/__layout.reset.svelte b/src/routes/login/__layout.reset.svelte deleted file mode 100644 index 2478b25..0000000 --- a/src/routes/login/__layout.reset.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - -
- -