update auth

This commit is contained in:
2025-11-24 16:08:16 +03:30
parent e79040d81e
commit 9996ea3b09
8 changed files with 91 additions and 366 deletions
@@ -1,22 +0,0 @@
import { Entity, ManyToOne, Opt, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Restaurant } from '../../../modules/restaurants/entities/restaurant.entity';
@Entity({ tableName: 'refreshtokens' })
export class RefreshToken extends BaseEntity {
@Property({ type: 'varchar', length: 255 })
token!: string;
@Property()
ownerId!: string;
@ManyToOne(() => Restaurant, { deleteRule: 'cascade' })
restaurant!: Restaurant;
@Property({ type: 'timestamptz' })
expiresAt!: Date;
@Property({ default: false })
isRevoked: boolean & Opt;
}
+1 -2
View File
@@ -7,12 +7,11 @@ import { User } from './entities/user.entity';
import { UserAddress } from './entities/user-address.entity';
import { JwtModule } from '@nestjs/jwt';
import { UserRepository } from './repositories/user.repository';
import { RefreshToken } from './entities/refresh-token.entity';
@Module({
providers: [UserService, UserRepository],
controllers: [UsersController, PublicUserController],
imports: [MikroOrmModule.forFeature([User, UserAddress, RefreshToken]), JwtModule],
imports: [MikroOrmModule.forFeature([User, UserAddress]), JwtModule],
exports: [UserService, UserRepository],
})
export class UserModule {}