trying new auth method of using uuid instead of ip address. ip address is causing issues. Updated axios to automatically put the uuid header. Added util to remove user tokens

This commit is contained in:
kyle hoell
2020-12-08 08:13:40 -05:00
parent 025bef8f7d
commit 39b22ee2ab
18 changed files with 156 additions and 62 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ type userAccessType = {
botChecked: boolean,
}
const userUpdateCheck = async(res: Response, id: string, ipAddress: string | undefined) => {
const userUpdateCheck = async(res: Response, id: string, uuid: string | undefined) => {
const updatedUser = await User.findById(id);
@@ -25,7 +25,7 @@ const userUpdateCheck = async(res: Response, id: string, ipAddress: string | und
if (updatedUser.emailVerified) {
const {accessToken, refreshToken} = await updatedUser.generateAuthToken(ipAddress);
const {accessToken, refreshToken} = await updatedUser.generateAuthToken(uuid);
createLoginCookie(res, accessToken, refreshToken);
}