Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for session expiresAt #115

Closed
nakahara-d opened this issue Jun 28, 2023 · 1 comment
Closed

check for session expiresAt #115

nakahara-d opened this issue Jun 28, 2023 · 1 comment

Comments

@nakahara-d
Copy link

Shouldn’t you check the expiresAt of the session in get? The session may be expired.

public readonly get = async (
sid: string,
callback?: (err?: unknown, val?: SessionData) => void
) => {
if (!(await this.validateConnection())) return callback?.();
const session = await this.prisma[this.sessionModelName]
.findUnique({
where: { sid },
})
.catch(() => null);
if (session === null) return callback?.();
try {
const result = this.serializer.parse(session.data ?? '{}') as SessionData;
if (callback) defer(callback, undefined, result);
return result;
} catch (e: unknown) {
this.logger.error(`get(): ${String(e)}`);
if (callback) defer(callback, e);
}
};

kleydon added a commit that referenced this issue Jun 28, 2023
* Fix for issue #115
* Adjusted tslint configuration to un-break it
@kleydon
Copy link
Owner

kleydon commented Jun 28, 2023

Thanks @nakahara-d - fixed in PR #116

@kleydon kleydon closed this as completed Jun 28, 2023
kleydon pushed a commit that referenced this issue Jun 28, 2023
## [3.1.13](v3.1.12...v3.1.13) (2023-06-28)

### Bug Fixes

* adjusted a test ([7ef28a8](7ef28a8))
* dont get expired session ([de9304d](de9304d)), closes [#115](#115)
* fixed test case ([15e8381](15e8381))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants