Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import AuthenticationContext from "adal-angular/lib/adal";
- const callback = (errorDesc, token, error, tokenType) => {
- // expect to hit this after successful email and password combo
- };
- const config = {
- clientId: process.env.CLIENT_ID,
- popUp: true,
- cacheLocation: "localStorage",
- callback,
- };
- export default new AuthenticationContext(config);
- componentWillMount() {
- const user = auth.getCachedUser();
- if (user) {
- console.log(user);
- } else {
- auth.login();
- }
- }
Add Comment
Please, Sign In to add comment