Reduce duplicate code, move shit out to common package
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Types } from 'mongoose';
|
||||
|
||||
import { Log, Strategy, Token } from '..';
|
||||
import { STRATEGIES } from '../constants/strategies';
|
||||
import { Action } from '@mifi/auth-common/lib/enums/action';
|
||||
import { STRATEGIES } from '@mifi/auth-common/lib/enums/strategies';
|
||||
import { generateLoginToken } from '@mifi/auth-common/lib/utils/generateLoginToken';
|
||||
|
||||
import { AuthDocument } from '../schema/auth';
|
||||
import { getLoginToken } from '../utils/getLoginToken';
|
||||
import { StrategyDocument } from '../schema/strategy';
|
||||
import { Action } from '../constants/action';
|
||||
import { Log, Strategy, Token } from '..';
|
||||
|
||||
export const resetPasswordPost = async (token: string, password: string) => {
|
||||
const parentId = await Token.validateResetToken(token);
|
||||
@@ -34,7 +35,7 @@ export const resetPasswordPost = async (token: string, password: string) => {
|
||||
}
|
||||
|
||||
Log.add(parent._id, Action.RESET);
|
||||
return { record: parent.record, token: getLoginToken(parent) };
|
||||
return { record: parent.record, token: generateLoginToken(parent) };
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user