This repository has been archived by the owner on May 5, 2022. It is now read-only.
Releases: salte-io/salte-auth-angularjs
Releases · salte-io/salte-auth-angularjs
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.4
v2.0.3
v2.0.2
v2.0.0
New Features
Manually Execute a Login
exampleModule.controller((SalteAuthService) => {
SalteAuthService.loginWithIframe().then(() => {
// We successfully logged in!
}).catch((error) => {
// Whoops, looks like something went wrong!
});
SalteAuthService.loginWithPopup().then(() => {
// We successfully logged in!
}).catch((error) => {
// Whoops, looks like something went wrong!
});
// We don't recommend logging in via redirect
// since we can't return a promise.
SalteAuthService.loginWithRedirect();
});
Manually Execute a Logout
exampleModule.controller((SalteAuthService) => {
SalteAuthService.logoutWithIframe().then(() => {
// We successfully logged out!
}).catch((error) => {
// Whoops, looks like something went wrong!
});
SalteAuthService.logoutWithPopup().then(() => {
// We successfully logged out!
}).catch((error) => {
// Whoops, looks like something went wrong!
});
// We don't recommend logging out via redirect
// since we can't return a promise.
SalteAuthService.logoutWithRedirect();
});
Support for UI Router 1.x+
We now support UI Router 1.x+!
BREAKING CHANGES
Setup - init -> setup
Before
exampleModule.config(($httpProvider, salteAuthServiceProvider) => {
// ...
salteAuthServiceProvider.init({
url: 'https://salte-io.auth0.com',
responseType: 'id_token',
redirectUrl: location.origin,
clientId: 'Hzl9Rvu_Ws_s1QKIhI2TXi8NZRn672FC',
scope: 'openid',
securedEndpoints: {
'/api' : 'mySecuredAPI'
}
}, $httpProvider);
}
After
exampleModule.config((SalteAuthServiceProvider) => {
// ...
SalteAuthServiceProvider.setup({
providerUrl: 'https://salte-io.auth0.com',
responseType: 'id_token',
redirectUrl: location.origin,
clientId: 'Hzl9Rvu_Ws_s1QKIhI2TXi8NZRn672FC',
scope: 'openid',
endpoints: [
'/api'
],
provider: 'auth0'
});
}
Securing Routes - requireAuthentication -> secured
Before
exampleModule.config(($stateProvider) => {
// ...
$stateProvider.state({
// ...
requireAuthentication: true
});
}
After
exampleModule.config(($stateProvider) => {
// ...
$stateProvider.state({
// ...
secured: true
});
}