Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nexys-system/oauth
simple oauth wrapper
https://github.com/nexys-system/oauth
github gitlab google microsoft nexys oauth2 swissid typescript zoho
Last synced: 24 days ago
JSON representation
simple oauth wrapper
- Host: GitHub
- URL: https://github.com/nexys-system/oauth
- Owner: nexys-system
- License: mit
- Created: 2021-07-26T20:55:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T23:13:08.000Z (7 months ago)
- Last Synced: 2024-10-01T15:08:15.473Z (about 1 month ago)
- Topics: github, gitlab, google, microsoft, nexys, oauth2, swissid, typescript, zoho
- Language: TypeScript
- Homepage:
- Size: 250 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OAuth helpers
[![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/badge/code_style-prettier-ff69b4.svg)](https://prettier.io/)
[![Build and Test Package](https://github.com/nexys-system/oauth/actions/workflows/test.yml/badge.svg)](https://github.com/nexys-system/oauth/actions/workflows/test.yml)
[![Build and Test Package and (publish)](https://github.com/nexys-system/oauth/actions/workflows/publish.yml/badge.svg)](https://github.com/nexys-system/oauth/actions/workflows/publish.yml)```
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](https://github.com/nexys-system/oauth/commit/1679c3799af8f4d53d4a4a23c21fed9dfcb0ab9a) (deleted from the repo, to reduce the amount of dependencies)