|
|
@@ -49,16 +49,14 @@ export default {
|
|
49
|
49
|
throw new Error('accessToken not in cookie store!')
|
|
50
|
50
|
},
|
|
51
|
51
|
async verifyActiveSession(hashedToken) {
|
|
52
|
|
- const sessionData = await authenticator.verifyAuthSession(
|
|
53
|
|
- hashedToken,
|
|
54
|
|
- )
|
|
|
52
|
+ const sessionData =
|
|
|
53
|
+ await authenticator.verifyAuthSession(hashedToken)
|
|
55
|
54
|
if (!sessionData.hashesMatch)
|
|
56
|
55
|
throw new Error('Hash is not in activeSessions!')
|
|
57
|
56
|
},
|
|
58
|
57
|
async isSessionTokenValid(hash) {
|
|
59
|
|
- const sessionTokenIsValid = await authenticator.validateSession(
|
|
60
|
|
- hash,
|
|
61
|
|
- )
|
|
|
58
|
+ const sessionTokenIsValid =
|
|
|
59
|
+ await authenticator.validateSession(hash)
|
|
62
|
60
|
if (sessionTokenIsValid.error) {
|
|
63
|
61
|
throw new Error(sessionTokenIsValid.error)
|
|
64
|
62
|
} else return sessionTokenIsValid
|