jwt
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
|
||||
import { Module } from '@nestjs/common';
|
||||
import { UsersService } from './users.service';
|
||||
|
||||
@Module({
|
||||
providers: [UsersService],
|
||||
exports: [UsersService],
|
||||
})
|
||||
export class UsersModule {}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
export type User = any;
|
||||
|
||||
@Injectable()
|
||||
export class UsersService {
|
||||
private readonly users = [
|
||||
{
|
||||
userId: 1,
|
||||
username: 'john',
|
||||
password: 'changeme',
|
||||
},
|
||||
{
|
||||
userId: 2,
|
||||
username: 'maria',
|
||||
password: 'guess',
|
||||
},
|
||||
];
|
||||
|
||||
async findOne(username: string): Promise<User | undefined> {
|
||||
return this.users.find(user => user.username === username);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
export type User = any;
|
||||
|
||||
@Injectable()
|
||||
export class UsersService {
|
||||
private readonly users = [
|
||||
{
|
||||
userId: 1,
|
||||
username: 'john',
|
||||
password: 'changeme',
|
||||
},
|
||||
{
|
||||
userId: 2,
|
||||
username: 'maria',
|
||||
password: 'guess',
|
||||
},
|
||||
];
|
||||
|
||||
async findOne(username: string): Promise<User | undefined> {
|
||||
return this.users.find(user => user.username === username);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user