mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
private: adds tokens controller
adds private api adds AuthTokenDto and AuthTokenWithSecretDto adds necessary methods in the users service adds RandomnessError Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
b586b9ffb2
commit
cbf6ac912a
10 changed files with 248 additions and 12 deletions
|
@ -10,7 +10,7 @@ import {
|
|||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { Column, OneToMany } from 'typeorm/index';
|
||||
import { Column, OneToMany } from 'typeorm';
|
||||
import { Note } from '../notes/note.entity';
|
||||
import { AuthToken } from './auth-token.entity';
|
||||
import { Identity } from './identity.entity';
|
||||
|
@ -46,7 +46,7 @@ export class User {
|
|||
ownedNotes: Note[];
|
||||
|
||||
@OneToMany((_) => AuthToken, (authToken) => authToken.user)
|
||||
authToken: AuthToken[];
|
||||
authTokens: AuthToken[];
|
||||
|
||||
@OneToMany((_) => Identity, (identity) => identity.user)
|
||||
identities: Identity[];
|
||||
|
@ -59,7 +59,7 @@ export class User {
|
|||
displayName: string,
|
||||
): Pick<
|
||||
User,
|
||||
'userName' | 'displayName' | 'ownedNotes' | 'authToken' | 'identities'
|
||||
'userName' | 'displayName' | 'ownedNotes' | 'authTokens' | 'identities'
|
||||
> {
|
||||
const newUser = new User();
|
||||
newUser.userName = userName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue