Skip to content

Commit bfd5109

Browse files
author
alxndrsn
committed
query/sessions: return promise from getByBearerToken() for invalid token
1 parent 6770716 commit bfd5109

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/model/query/sessions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const getByBearerToken = (token) => ({ maybeOne }) => (isValidToken(token) ? may
3232
select ${_unjoiner.fields} from sessions
3333
join actors on actors.id=sessions."actorId"
3434
where token=${token} and sessions."expiresAt" > now()`)
35-
.then(map(_unjoiner)) : Option.none());
35+
.then(map(_unjoiner)) : Promise.resolve(Option.none()));
3636

3737
const terminateByActorId = (actorId, current = undefined) => ({ run }) =>
3838
run(sql`DELETE FROM sessions WHERE "actorId"=${actorId}

0 commit comments

Comments
 (0)