parent
6244c969af
commit
6ae0c1b955
@ -1,4 +1,5 @@
|
||||
import { IsEmail, IsOptional, IsString } from 'class-validator';
|
||||
import * as jsonwebtoken from 'jsonwebtoken';
|
||||
import { getConnectionManager } from 'typeorm';
|
||||
import { PasswordNeededError, UserNotFoundError } from '../../errors/AuthError';
|
||||
import { UsernameOrEmailNeededError } from '../../errors/UserErrors';
|
||||
@ -29,12 +30,14 @@ export class CreateAuth {
|
||||
if (found_users.length === 0) {
|
||||
throw new UserNotFoundError()
|
||||
} else {
|
||||
const found_user = found_users[0]
|
||||
const token = jsonwebtoken.sign(found_user, "sec")
|
||||
|
||||
// TODO: jwt creation
|
||||
newAuth.access_token = ""
|
||||
newAuth.refresh_token = ""
|
||||
newAuth.access_token_expires_at = 1587349200
|
||||
newAuth.refresh_token_expires_at = 1587349200
|
||||
// TODO: jwt creation
|
||||
newAuth.access_token = token
|
||||
newAuth.refresh_token = token
|
||||
newAuth.access_token_expires_at = 1587349200
|
||||
newAuth.refresh_token_expires_at = 1587349200
|
||||
|
||||
console.log(newAuth)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user