Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import {AuthenticationContext} from 'react-adal'
  2. import AdalConfig from '../Configs/AdalConfig'
  3.  
  4. export const authContext = new AuthenticationContext(AdalConfig);
  5.  
  6. export const acquireToken = (func) =>
  7. authContext.acquireToken(AdalConfig.endpoints.api, func);
  8.  
  9. export const getToken = (fnc) =>{
  10. if(authContext.getCachedUser() == null){
  11. authContext.login();
  12. }
  13.  
  14. authContext.acquireToken(AdalConfig.endpoints.api, fnc);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement