Browse Source

Feature/remove alias from user (#1218)

* Remove alias

* Update changelog
pull/1220/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
a3bfa46fb0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/api/src/app/auth/web-auth.service.ts
  3. 4
      apps/api/src/app/user/user.service.ts
  4. 2
      prisma/migrations/20220903065048_removed_alias_from_user/migration.sql
  5. 1
      prisma/schema.prisma
  6. 1
      prisma/seed.js

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Decreased the rate limiter duration of queue jobs from 5 to 4 seconds - Decreased the rate limiter duration of queue jobs from 5 to 4 seconds
- Removed the alias from the `User` database schema
### Fixed ### Fixed

2
apps/api/src/app/auth/web-auth.service.ts

@ -54,7 +54,7 @@ export class WebAuthService {
rpName: 'Ghostfolio', rpName: 'Ghostfolio',
rpID: this.rpID, rpID: this.rpID,
userID: user.id, userID: user.id,
userName: user.alias, userName: '',
timeout: 60000, timeout: 60000,
attestationType: 'indirect', attestationType: 'indirect',
authenticatorSelection: { authenticatorSelection: {

4
apps/api/src/app/user/user.service.ts

@ -43,7 +43,7 @@ export class UserService {
include: { include: {
User: true User: true
}, },
orderBy: { User: { alias: 'asc' } }, orderBy: { alias: 'asc' },
where: { GranteeUser: { id } } where: { GranteeUser: { id } }
}); });
let tags = await this.tagService.getByUser(id); let tags = await this.tagService.getByUser(id);
@ -98,7 +98,6 @@ export class UserService {
const { const {
accessToken, accessToken,
Account, Account,
alias,
authChallenge, authChallenge,
createdAt, createdAt,
id, id,
@ -116,7 +115,6 @@ export class UserService {
const user: UserWithSettings = { const user: UserWithSettings = {
accessToken, accessToken,
Account, Account,
alias,
authChallenge, authChallenge,
createdAt, createdAt,
id, id,

2
prisma/migrations/20220903065048_removed_alias_from_user/migration.sql

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" DROP COLUMN "alias";

1
prisma/schema.prisma

@ -160,7 +160,6 @@ model Tag {
model User { model User {
accessToken String? accessToken String?
alias String?
authChallenge String? authChallenge String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
id String @id @default(uuid()) id String @id @default(uuid())

1
prisma/seed.js

@ -111,7 +111,6 @@ async function main() {
} }
] ]
}, },
alias: 'Demo',
id: '9b112b4d-3b7d-4bad-9bdd-3b0f7b4dac2f', id: '9b112b4d-3b7d-4bad-9bdd-3b0f7b4dac2f',
role: Role.DEMO role: Role.DEMO
}, },

Loading…
Cancel
Save