feat: change auth to use cookies (#301)

* frontend cookie implementation

* accept cookies for authentication

* remove auth store

* add self attr
This commit is contained in:
Hayden 2023-02-17 21:57:21 -09:00 committed by GitHub
parent bd321af29f
commit 12975ce26e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 204 additions and 86 deletions

View file

@ -1,11 +1,9 @@
<script lang="ts" setup>
import { useAuthStore } from "~~/stores/auth";
const authStore = useAuthStore();
const ctx = useAuthContext();
const api = useUserApi();
async function logout() {
const { error } = await authStore.logout(api);
const { error } = await ctx.logout(api);
if (error) {
return;
}