npm-login-cognito
v1.0.2
Published
A package for cognito login link creation
Downloads
5
Readme
npm-login-cognito
A package for cognito login url creation
Install
npm install npm-login-cognito
Usage
const loginCognito = require("npm-login-cognito");
let cognitoTokenType = "Cognito Token Type"; // Replae cognito token type
let loginCognitoUrl = "Cognito Login URL"; // Replae cognito login url
let cognitoClientId = "Cognito Client Id"; // Replae cognito client id
let redirectURI = "Redirection URL"; // Replace redirection url after login
let loginCognitoURLObj = loginCognito.loginCognito.loginLink(cognitoTokenType, loginCognitoUrl, cognitoClientId, redirectURI);
if(loginCognitoURLObj.status=='200'){
windows.location = loginCognitoURLObj.url;
}else{
console.log(loginCognitoURLObj.message); //loginCognitoURLObj.message contains error message.
}