update auth
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user