mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor: Move API keys into their own table (no-changelog) (#10629)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -23,6 +23,7 @@ import { NoUrl } from '@/validators/no-url.validator';
|
||||
import { NoXss } from '@/validators/no-xss.validator';
|
||||
|
||||
import { WithTimestamps, jsonColumnType } from './abstract-entity';
|
||||
import type { ApiKey } from './api-key';
|
||||
import type { AuthIdentity } from './auth-identity';
|
||||
import type { ProjectRelation } from './project-relation';
|
||||
import type { SharedCredentials } from './shared-credentials';
|
||||
@@ -89,6 +90,9 @@ export class User extends WithTimestamps implements IUser {
|
||||
@OneToMany('AuthIdentity', 'user')
|
||||
authIdentities: AuthIdentity[];
|
||||
|
||||
@OneToMany('ApiKey', 'user')
|
||||
apiKeys: ApiKey[];
|
||||
|
||||
@OneToMany('SharedWorkflow', 'user')
|
||||
sharedWorkflows: SharedWorkflow[];
|
||||
|
||||
@@ -107,10 +111,6 @@ export class User extends WithTimestamps implements IUser {
|
||||
this.email = this.email?.toLowerCase() ?? null;
|
||||
}
|
||||
|
||||
@Column({ type: String, nullable: true })
|
||||
@Index({ unique: true })
|
||||
apiKey: string | null;
|
||||
|
||||
@Column({ type: Boolean, default: false })
|
||||
mfaEnabled: boolean;
|
||||
|
||||
@@ -151,7 +151,7 @@ export class User extends WithTimestamps implements IUser {
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
const { password, apiKey, ...rest } = this;
|
||||
const { password, ...rest } = this;
|
||||
return rest;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user