clean up dead code/unused imports
This commit is contained in:
parent
ec543afcb2
commit
f6536baec2
|
@ -1,4 +1,4 @@
|
|||
import {BeforeInsert, Column, Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
import {Column, Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
|
||||
import {AuthProvider} from '$lib/server/auth';
|
||||
import {User} from '$lib/server/entity/User';
|
||||
|
@ -20,9 +20,4 @@ export class AuthMethod {
|
|||
onDelete: 'CASCADE',
|
||||
})
|
||||
user!: User;
|
||||
|
||||
@BeforeInsert()
|
||||
private beforeInsert () {
|
||||
this.id = ulidMonotonic();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {BeforeInsert, Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
import {Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
|
||||
import {AuthMethod} from '$lib/server/entity/AuthMethod';
|
||||
import {ulidMonotonic} from '$lib/server/ulid';
|
||||
|
@ -17,9 +17,4 @@ export class AuthSession {
|
|||
authMethod!: AuthMethod;
|
||||
|
||||
// TODO expiration of sessions?
|
||||
|
||||
@BeforeInsert()
|
||||
private beforeInsert () {
|
||||
this.id = ulidMonotonic();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as crypto from 'node:crypto';
|
||||
import {BeforeInsert, Column, Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
import {Column, Entity, PrimaryColumn} from 'typeorm';
|
||||
|
||||
import {AuthProvider} from '$lib/server/auth';
|
||||
import {ulidMonotonic} from '$lib/server/ulid';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {BeforeInsert, Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
import {Entity, ManyToOne, PrimaryColumn} from 'typeorm';
|
||||
|
||||
import {Node} from '$lib/server/entity/Node';
|
||||
import {ulidMonotonic} from '$lib/server/ulid';
|
||||
|
@ -21,9 +21,4 @@ export class Edge {
|
|||
onDelete: 'CASCADE',
|
||||
})
|
||||
tail!: Node;
|
||||
|
||||
@BeforeInsert()
|
||||
beforeInsert () {
|
||||
this.id = ulidMonotonic();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {BeforeInsert, Column, Entity, OneToMany, PrimaryColumn} from 'typeorm';
|
||||
import {Column, Entity, OneToMany, PrimaryColumn} from 'typeorm';
|
||||
|
||||
import {Edge} from '$lib/server/entity/Edge';
|
||||
import {ulidMonotonic} from '$lib/server/ulid';
|
||||
|
@ -22,9 +22,4 @@ export class Node {
|
|||
onDelete: 'CASCADE',
|
||||
})
|
||||
incomingEdges!: Edge[];
|
||||
|
||||
@BeforeInsert()
|
||||
private beforeInsert () {
|
||||
this.id = ulidMonotonic();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {
|
||||
BeforeInsert,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
|
@ -23,9 +22,4 @@ export class User {
|
|||
|
||||
@OneToMany(() => AuthMethod, authMethod => authMethod.user)
|
||||
authMethods!: AuthMethod[];
|
||||
|
||||
@BeforeInsert()
|
||||
private beforeInsert () {
|
||||
this.id = ulidMonotonic();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,6 @@ import {getUserFromSessionID} from '$lib/server/sessionutil';
|
|||
|
||||
import type {LayoutServerLoad} from './$types';
|
||||
|
||||
async function findSession (sessionID?: string) {
|
||||
const dataSource = await getDataSource();
|
||||
const sessionsRepo = dataSource.getRepository(AuthSession);
|
||||
|
||||
if (!sessionID) { return null; }
|
||||
return await sessionsRepo.findOne({where: {id: sessionID}});
|
||||
}
|
||||
|
||||
export const load: LayoutServerLoad = async ({cookies}) => {
|
||||
return JSON.parse(JSON.stringify({
|
||||
user: await getUserFromSessionID(cookies.get(Cookie.SESSION_ID)),
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
import {redirect} from '@sveltejs/kit';
|
||||
import * as crypto from 'node:crypto';
|
||||
|
||||
import {AuthProvider, authProviderImplementations} from '$lib/server/auth';
|
||||
import {Cookie} from '$lib/server/cookies';
|
||||
import {getDataSource} from '$lib/server/db';
|
||||
import {AuthState} from '$lib/server/entity/AuthState';
|
||||
|
||||
import {env} from '$env/dynamic/private';
|
||||
import {
|
||||
AuthProvider,
|
||||
type AuthProviderImplementation,
|
||||
authProviderImplementations,
|
||||
} from '$lib/server/auth';
|
||||
import {Cookie} from '$lib/server/cookies';
|
||||
import type {PageServerLoad} from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({cookies, params, url}) => {
|
||||
|
|
Loading…
Reference in a new issue