Commit 61783a90 authored by Sylvain Le Bon's avatar Sylvain Le Bon

bugfix: renamed methods

parent 5eb1a556
......@@ -5,7 +5,7 @@ if (typeof Oidc == "undefined") {
// Var declarations
var sib = {oidc: {}};
sib.oidc._applyBindUser = function() {
sib.oidc.getUser = function() {
sib.oidc._manager.getUser()
.then(user => {
sib.oidc.user = user;
......@@ -29,14 +29,14 @@ sib.oidc.handleRedirection = function() {
}
// Connect to OIDC provider
sib.oidc._connect = function(settings) {
sib.oidc.connect = function(settings) {
if (typeof sib.oidc._manager == "undefined")
sib.oidc._manager = new Oidc.UserManager(settings);
sib.oidc._getUser()
sib.oidc.getUser()
// When user loaded...
sib.oidc._manager.events.addUserLoaded(user => sib.oidc.handleRedirection());
}
const settings = Object.assign({}, {redirect_uri: document.location.origin}, document.currentScript.dataset);
sib.oidc._connect(settings);
\ No newline at end of file
sib.oidc.connect(settings);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment