Guest User

Untitled

a guest
Nov 15th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. async execute(url, method, body = undefined) {
  2. console.log('API: ', url, method, body);
  3. if(typeof body === 'object')
  4. body = JSON.stringify(body);
  5. let headers = this.getHeaders();
  6. return await fetch(url, {
  7. headers,
  8. method,
  9. body,
  10. mode: 'no-cors',
  11. redirect: 'follow'
  12. });
  13. }
  14.  
  15. componentDidMount() {
  16. console.log('AuthCallback componentDidMount()');
  17. if (/access_token|id_token|error/.test(this.props.location.hash)) {
  18. Auth.handleAuthentication(this.props.location.hash);
  19. }
  20. }
Add Comment
Please, Sign In to add comment