@enjoys/sso
v1.0.0
Published
``` const { SSO } = require("@enjoys/sso"); // import {SSO} from "@enjoys/sso"; const config = new SSO({ client_id: "client_id", // retrive cleint id from enjoys panel by creating Oauth App redirect_uri: "http://localhost:3000/callback", //
Downloads
4
Readme
Usage Example
const { SSO } = require("@enjoys/sso");
// import {SSO} from "@enjoys/sso";
const config = new SSO({
client_id: "client_id",
// retrive cleint id from enjoys panel by creating Oauth App
redirect_uri: "http://localhost:3000/callback",
// url where you want to redirect after successfull login
o2v: "http://localhost:3000",
response_type: "code",
scope: "*",
// * retreive all data(name,email,cleint side data) , 1, email and image,2 email only
state: "stateid",
// generate a random id to store as session id
flowName: "GeneralOAuthFlow",// use this flow as default
});
console.log(config .genrateUrl())
Output
https://accounts.enjoys.in/o/oauth2/auth/oauthchooseaccount?client_id=client_id&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcallback&o2v=http%3A%2F%2Flocalhost%3A3000&response_type=code&scope=*&state=stateid&flowName=GeneralOAuthFl
Redirect to this url and login with Enjoys account, if you have account already then will redirect to url specified in config