Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions composables/useAuth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useDataManager } from "./useDataManager";

export const useAuth = () => {
// Cookie management for persistence
const userCookie = useCookie('auth.user', {
Expand Down Expand Up @@ -38,6 +40,11 @@ export const useAuth = () => {

const login = async (credentials: { email: string; password: string }) => {
try {
//clear data before new login
const { clearData } = useDataManager();
clearData();


const api = useApi();
const response = await api('/login', {
method: 'POST',
Expand Down
Loading