diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-05-04 15:05:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-04 15:05:34 +0900 |
| commit | 6ae642245e0322f194ca5d960f669f33ba38c2fa (patch) | |
| tree | f71ac2c1a2d0aa616d4e99d37c00787219c5e3d0 /src/models/entities | |
| parent | Fix style (diff) | |
| download | misskey-6ae642245e0322f194ca5d960f669f33ba38c2fa.tar.gz misskey-6ae642245e0322f194ca5d960f669f33ba38c2fa.tar.bz2 misskey-6ae642245e0322f194ca5d960f669f33ba38c2fa.zip | |
Password reset (#7494)
* wip
* wip
* Update well-known.ts
* wip
* clean up
* Update request-reset-password.ts
* Update forgot-password.vue
* Update reset-password.ts
* Update request-reset-password.ts
Diffstat (limited to 'src/models/entities')
| -rw-r--r-- | src/models/entities/password-reset-request.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/models/entities/password-reset-request.ts b/src/models/entities/password-reset-request.ts new file mode 100644 index 0000000000..6d41d38a93 --- /dev/null +++ b/src/models/entities/password-reset-request.ts @@ -0,0 +1,30 @@ +import { PrimaryColumn, Entity, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; +import { id } from '../id'; +import { User } from './user'; + +@Entity() +export class PasswordResetRequest { + @PrimaryColumn(id()) + public id: string; + + @Column('timestamp with time zone') + public createdAt: Date; + + @Index({ unique: true }) + @Column('varchar', { + length: 256, + }) + public token: string; + + @Index() + @Column({ + ...id(), + }) + public userId: User['id']; + + @ManyToOne(type => User, { + onDelete: 'CASCADE' + }) + @JoinColumn() + public user: User | null; +} |