Finishing touches to publish
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-03 11:38:41 -04:00
parent dc72cefece
commit 32bfbd7adc
15 changed files with 36 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
import jwt from 'jsonwebtoken';
import { JWT_AUDIENCE, JWT_ISSUER, JWT_SECRET } from '../constants/constants';
import { JWT_AUDIENCE, JWT_ISSUER, JWT_SECRET } from '../constants/env';
export interface TokenProps {
aud?: string;
exp?: number | Date;

View File

@@ -1,3 +1,3 @@
import { RESET_ROUTE, ROUTE_PREFIX } from '../constants/constants';
import { RESET_ROUTE, ROUTE_PREFIX } from '../constants/env';
export const getPasswordResetPath = (token: string) => `${ROUTE_PREFIX}${RESET_ROUTE}?t=${token}`;

View File

@@ -1,7 +1,7 @@
import crypto from 'crypto';
import { sign } from './jwt';
import { LOGIN_VALID_TIME, RESET_VALID_MINUTES } from '../constants/constants';
import { LOGIN_VALID_TIME, RESET_VALID_MINUTES } from '../constants/env';
import { Status } from '../constants/auth';
const parseLoginValid = () => {
@@ -14,12 +14,12 @@ const parseLoginValid = () => {
};
export const generateLoginToken = (sub: string, status: Status) => {
const [days, hours, mins] = parseLoginValid();
return sign({
sub,
status,
exp: Date.now() + days * hours * mins * 60 * 1000,
});
const [days, hours, mins] = parseLoginValid();
return sign({
sub,
status,
exp: Date.now() + days * hours * mins * 60 * 1000,
});
};
export const generateResetToken = (sub: string) => {