Guest User

Untitled

a guest
Dec 11th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import AuthenticationContext from "adal-angular/lib/adal";
  2.  
  3. const callback = (errorDesc, token, error, tokenType) => {
  4. // expect to hit this after successful email and password combo
  5. };
  6.  
  7. const config = {
  8. clientId: process.env.CLIENT_ID,
  9. popUp: true,
  10. cacheLocation: "localStorage",
  11. callback,
  12. };
  13.  
  14. export default new AuthenticationContext(config);
  15.  
  16. componentWillMount() {
  17. const user = auth.getCachedUser();
  18. if (user) {
  19. console.log(user);
  20. } else {
  21. auth.login();
  22. }
  23. }
Add Comment
Please, Sign In to add comment