Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
signInWithPopup() {
if (this.requireClientId()) {
UserSession.beginOAuth2({
clientId: this.clientId,
// Passing the clientid here is only a requirement of this demo where we allow
// dynamic clientids via input. Typically you would have this hard-coded on
// the authorization callback.
redirectUri: `${this.redirect_uri}#/authenticate?clientID=${
this.clientId
}`,
popup: true
})
.then(session => {
// Upon successful login, update the application's store with this new
// session.
this.$store.dispatch("updateSession", session);
})
.catch(error);
}
signInWithInlineRedirect() {
if (this.requireClientId()) {
UserSession.beginOAuth2({
clientId: this.clientId,
redirectUri: `${this.redirect_uri}#/authenticate?clientID=${
this.clientId
}`,
popup: false
});
}
},
// Function to log the use out of the current session.