refactor(backend): rename auth to public-auth-token

Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2024-09-01 14:57:25 +02:00 committed by Philip Molares
parent 52fe7f55de
commit 73d9c3231b
30 changed files with 338 additions and 327 deletions

View file

@ -13,13 +13,13 @@ import {
UpdateDateColumn,
} from 'typeorm';
import { AuthToken } from '../auth/auth-token.entity';
import { Author } from '../authors/author.entity';
import { Group } from '../groups/group.entity';
import { HistoryEntry } from '../history/history-entry.entity';
import { Identity } from '../identity/identity.entity';
import { MediaUpload } from '../media/media-upload.entity';
import { Note } from '../notes/note.entity';
import { PublicAuthToken } from '../public-auth-token/public-auth-token.entity';
import { Username } from '../utils/username';
@Entity()
@ -56,8 +56,8 @@ export class User {
@OneToMany((_) => Note, (note) => note.owner)
ownedNotes: Promise<Note[]>;
@OneToMany((_) => AuthToken, (authToken) => authToken.user)
authTokens: Promise<AuthToken[]>;
@OneToMany((_) => PublicAuthToken, (authToken) => authToken.user)
publicAuthTokens: Promise<PublicAuthToken[]>;
@OneToMany((_) => Identity, (identity) => identity.user)
identities: Promise<Identity[]>;
@ -87,7 +87,7 @@ export class User {
newUser.photo = null;
newUser.email = null;
newUser.ownedNotes = Promise.resolve([]);
newUser.authTokens = Promise.resolve([]);
newUser.publicAuthTokens = Promise.resolve([]);
newUser.identities = Promise.resolve([]);
newUser.groups = Promise.resolve([]);
newUser.historyEntries = Promise.resolve([]);