@nexys/oauth
v0.3.3
Published
[![NPM package](https://badge.fury.io/js/%40nexys%2Foauth.svg)](https://www.npmjs.com/package/@nexys/oauth) [![NPM package](https://img.shields.io/npm/v/@nexys/oauth.svg)](https://www.npmjs.com/package/@nexys/oauth) [![Prettier](https://img.shields.io/bad
Downloads
9
Readme
OAuth helpers
router.get("/sso/red", async (ctx) => {
ctx.redirect(gh.oAuthUrl());
});
router.get("/sso/github/redirect", async (ctx) => {
const { code } = ctx.query;
const token = await gh.callback(code as string);
const profile = await gh.getProfile(token);
// here connect to the user management
ctx.body = profile
});
Link to old generic route generator (deleted from the repo, to reduce the amount of dependencies)