latest work #20

Merged
philipp merged 233 commits from dev into main 2020-12-09 18:49:33 +00:00
Showing only changes of commit 6ae0c1b955 - Show all commits

View File

@ -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)
}