Auth SuperOAuth (JWT validation + httpOnly cookie), entités users/characters/level_thresholds, lazy calculation endurance, seed 100 niveaux, config prod-ready (trust proxy, helmet, CORS, rate limit). Validé : health 200, auth flow, character CRUD, endurance lazy, 401 sans cookie.
34 lines
641 B
TypeScript
34 lines
641 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
Unique,
|
|
} from 'typeorm';
|
|
|
|
@Entity('users')
|
|
@Unique(['oauthId', 'provider'])
|
|
export class User {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ name: 'oauth_id', length: 255 })
|
|
oauthId: string;
|
|
|
|
@Column({ length: 50 })
|
|
provider: string;
|
|
|
|
@Column({ length: 255 })
|
|
username: string;
|
|
|
|
@Column({ name: 'avatar_url', type: 'varchar', length: 500, nullable: true })
|
|
avatarUrl: string | null;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at' })
|
|
updatedAt: Date;
|
|
}
|