First part of the action comment refactoring
ref #39 Why did i volunteer for this? It's just a glorified sleeping aid 😴
This commit is contained in:
@@ -7,11 +7,23 @@ import { JwtCreator } from "../../jwtcreator";
|
||||
import { User } from '../entities/User';
|
||||
import { Auth } from '../responses/ResponseAuth';
|
||||
|
||||
/**
|
||||
* This class is used to create refreshed auth credentials.
|
||||
* To be a little bit more exact: Is takes in a refresh token and creates a new access and refresh token for it's user.
|
||||
* It of course checks for user existance, jwt validity and so on.
|
||||
*/
|
||||
export class RefreshAuth {
|
||||
/**
|
||||
* A stringyfied jwt refresh token.
|
||||
* Will get checked for validity.
|
||||
*/
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
token?: string;
|
||||
|
||||
/**
|
||||
* Creates a new auth object based on this.
|
||||
*/
|
||||
public async toAuth(): Promise<Auth> {
|
||||
let newAuth: Auth = new Auth();
|
||||
if (!this.token || this.token === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user