![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@tryghost/mw-session-from-token
Advanced tools
Middleware to handle generating sessions from tokens, for example like with magic links, or SSO flows similar to SAML.
Middleware to handle generating sessions from tokens, for example like with magic links, or SSO flows similar to SAML.
npm install @tryghost/mw-session-from-token --save
or
yarn add @tryghost/mw-session-from-token
const sessionFromTokenMiddleware = require('@tryghost/mw-session-from-token')({
callNextWithError: true,
async createSession(req, res, user) {
req.session.user_id = user.id;
},
async getTokenFromRequest(res) {
return req.headers['some-cool-header'];
},
async getLookupFromToken(token) {
await someTokenService.validate(token);
const data = await someTokenService.getData(token);
return data.email;
},
async findUserByLookup(lookup) {
return await someUserModel.findOne({email: lookup});
}
});
someExpressApp.get('/some/sso/url', someSessionMiddleware, sessionFromTokenMiddleware, (req, res, next) => {
res.redirect('/loggedin');
}, (err, res, res, next) => {
res.redirect('/error');
});
This is a mono repository, managed with lerna.
Follow the instructions for the top-level repo.
git clone
this repo & cd
into it as usualyarn
to install top-level dependencies.yarn dev
yarn lint
run just eslintyarn test
run lint and testsCopyright (c) 2013-2022 Ghost Foundation - Released under the MIT license.
FAQs
Middleware to handle generating sessions from tokens, for example like with magic links, or SSO flows similar to SAML.
The npm package @tryghost/mw-session-from-token receives a total of 0 weekly downloads. As such, @tryghost/mw-session-from-token popularity was classified as not popular.
We found that @tryghost/mw-session-from-token demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 22 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.