Skip to content

Commit

Permalink
fix: user delete, make sure we have identifier set
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpy committed Aug 11, 2019
1 parent 1072705 commit 983f508
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/login/login-middleware.js
Expand Up @@ -24,7 +24,7 @@ export const strategy = new Strategy(jwtOptions, async (jwtPayload, next) => {
let user = await GunDBPrivate.getUser(jwtPayload.loggedInAs)
log.debug('payload received', { jwtPayload, user })
//if user is empty make sure we have something
user = defaults(user, jwtPayload)
user = defaults(user, jwtPayload, { identifier: jwtPayload.loggedInAs })
if (get(jwtPayload, 'loggedInAs')) {
next(null, user)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/server/storage/storageAPI.js
Expand Up @@ -80,7 +80,7 @@ const setup = (app: Router, storage: StorageAPI) => {
Helper.delete(body.zoomId)
.then(r => ({ zoom: 'ok' }))
.catch(e => ({ zoom: 'failed' })),
(user.identifier ? storage.deleteUser(user) : Promise.resolve())
(user.identifier ? storage.deleteUser(user) : Promise.reject())
.then(r => ({ gundb: 'ok' }))
.catch(e => ({ gundb: 'failed' })),
Mautic.deleteContact(user)
Expand Down

0 comments on commit 983f508

Please sign in to comment.