1.0.5 • Published 5 years ago
rbtokens v1.0.5
RBTokens is a login plugin for partners of rbdigital
- DEMO: EDIT IN CODEPEN
Download and include
<script src="rbtokens.min.js"></script>
Install from npm
npm install --save rbtokens
API docs
config(settings)
RBTokens.config({ env: "qa", // optional, could be "qa", "stage", "uat" or "prod". default is "prod" libraryId: "3925", // required token: "BF8DD41C-B286-4F60-9FF5-F4C5B3E57A11", // required region: "NA", // required, could be "NA" or "EU" width: "400px", // optional template: { // optional id: "container", // required title: { // optional text: "Long into Your Account", // optional fontSize: "25px", // optional color: "#802754", // optional fontWeight: "700" // optional }, labels: { // optional indentifier: "LIBRARYCARD", // optional secret: "PIN", // optional fontSize: "14px", // optional color: "#48494A", // optional fontWeight: "600", // optional }, button: { text: "Log In", // optional fontSize: "16px", // optional color: "#fff", // optional fontWeight: "600", // optional backgroundColor: "#00a19b", // optional click : function (event, username, password) { // optional, click event handler RBTokens.loginAndRedirect({ "email": "jaswinder.singh0011@gmail.com"}).then(function(data){ console.log(data); }).catch(function(err){ console.log(err); }); }, }, } });
login(indentifier)
indentifier could be username, email or librarycardRBTokens.login({ "email": "jaswinder.singh0011@gmail.com"}).then(function(data){ }).catch(function(err){ });
loginAndRedirect(indentifier)
same tologin()
except it will redirect to rbdigital with bear tokenRBTokens.loginAndRedirect({ "email": "jaswinder.singh0011@gmail.com"}).then(function(data){ }).catch(function(err){ });
register(userinfo)
userinfo is an object with user informationRBTokens.register(userinfo).then(function(data){ }).catch(function(err){ });
registerAndRedirect(userinfo)
same toregister(userinfo)
except it will redirect to rbdigital with bear tokenRBTokens.registerAndRedirect(userinfo).then(function(data){ }).catch(function(err){ });