feat: login provider selection, logout, playlists pages
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 22s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 22s
- LoginPage : sélection Discord/GitHub/Google/Twitch via SuperOAuth - Header : bouton Connexion → /login, logout ↩ quand connecté, nav Playlists conditionnelle - useAuth : expose setUser pour logout côté Layout - PlaylistsPage : liste owned/shared, création inline - PlaylistPage : détail playlist + liste vidéos ordonnées - Fix : Video.id number → string (UUID) - Routes : /login, /playlists, /playlists/:id
This commit is contained in:
@@ -2,8 +2,8 @@ import { useState, useEffect } from 'react';
|
||||
import { apiFetch } from '../lib/api';
|
||||
|
||||
export interface User {
|
||||
id: number;
|
||||
email: string;
|
||||
id: string;
|
||||
email: string | null;
|
||||
nickname: string;
|
||||
subscriptionLevel?: number;
|
||||
}
|
||||
@@ -11,6 +11,7 @@ export interface User {
|
||||
interface AuthState {
|
||||
user: User | null;
|
||||
loading: boolean;
|
||||
setUser: (u: User | null) => void;
|
||||
}
|
||||
|
||||
interface MeResponse {
|
||||
@@ -33,5 +34,5 @@ export function useAuth(): AuthState {
|
||||
return () => { cancelled = true; };
|
||||
}, []);
|
||||
|
||||
return { user, loading };
|
||||
return { user, loading, setUser };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user