- Add Google OAuth 2.0 login flow with passport-google-oauth20 - Create User and RefreshToken entities for session management - Implement JWT access tokens (15min) + HttpOnly refresh cookies (7 days) - Add auth endpoints: /google, /google/callback, /refresh, /me, /logout - Create LoginPage with Google sign-in button (shadcn/ui) - Add AuthGuard for protected routes with redirect preservation - Implement silent token refresh on app mount - Add UserMenu component with avatar and sign-out Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 lines
426 B
TypeScript
29 lines
426 B
TypeScript
import { IsString, IsUUID, IsEmail, IsOptional, IsUrl } from 'class-validator';
|
|
|
|
export class UserResponseDto {
|
|
@IsUUID()
|
|
id: string;
|
|
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@IsString()
|
|
displayName: string;
|
|
|
|
@IsOptional()
|
|
@IsUrl()
|
|
avatarUrl?: string;
|
|
}
|
|
|
|
export class AuthResponseDto {
|
|
@IsString()
|
|
accessToken: string;
|
|
|
|
user: UserResponseDto;
|
|
}
|
|
|
|
export class MessageResponseDto {
|
|
@IsString()
|
|
message: string;
|
|
}
|