Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.18 KB

README.md

File metadata and controls

26 lines (19 loc) · 1.18 KB

OAuth helpers

NPM package NPM package Prettier Build and Test Package Build and Test Package and (publish)

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)