This commit is contained in:
seb
2026-08-05 08:19:13 +02:00
parent 3000d7d45c
commit a9e942df7a
8 changed files with 417 additions and 155 deletions

View File

@@ -1,7 +1,10 @@
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import { auth, company } from '../api';
export const bootstrapSession = createAsyncThunk('auth/bootstrap', async () => auth.me());
export const bootstrapSession = createAsyncThunk('auth/bootstrap', async (session) => {
if (session) return session;
return auth.me();
});
export const loginWithGoogle = createAsyncThunk('auth/login', async (credential) => {
const { session } = await auth.loginWithGoogle(credential);