Skip to content

nexys-system/oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)