daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top