mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
28 lines
683 B
TypeScript
28 lines
683 B
TypeScript
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { User } from './User';
|
|
|
|
@Entity('linked_accounts')
|
|
export class LinkedAccount {
|
|
constructor(options: Omit<LinkedAccount, 'id'>) {
|
|
Object.assign(this, options);
|
|
}
|
|
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@ManyToOne(() => User, (user) => user.linkedAccounts, { onDelete: 'CASCADE' })
|
|
user: User;
|
|
|
|
/** Slug of the OIDC provider. */
|
|
@Column({ type: 'varchar', length: 255 })
|
|
provider: string;
|
|
|
|
/** Unique ID from the OAuth provider */
|
|
@Column({ type: 'varchar', length: 255 })
|
|
sub: string;
|
|
|
|
/** Account username from the OAuth provider */
|
|
@Column()
|
|
username: string;
|
|
}
|