Refactor demo login as an authentication method
Use the authentication method system for the demo login and the generated accounts. This makes it possible to toggle it off on production systems as these shouldn't have it enabled at all.
This commit is contained in:
parent
a33c8e9dac
commit
0d0e38e4b6
14 changed files with 212 additions and 141 deletions
|
@ -44,14 +44,6 @@ export const useSessionStore = defineStore("session", () => {
|
|||
state.id.value = session?.id;
|
||||
state.push.value = session?.push ?? false;
|
||||
},
|
||||
async logIn(name: string) {
|
||||
const res = await $fetch.raw("/api/auth/login", {
|
||||
method: "POST",
|
||||
body: { name },
|
||||
});
|
||||
await actions.fetch();
|
||||
return `/api/auth/login replied: ${res.status} ${res.statusText}`;
|
||||
},
|
||||
async logOut() {
|
||||
try {
|
||||
await $fetch.raw("/api/auth/session", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue