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)