Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async execute(url, method, body = undefined) {
- console.log('API: ', url, method, body);
- if(typeof body === 'object')
- body = JSON.stringify(body);
- let headers = this.getHeaders();
- return await fetch(url, {
- headers,
- method,
- body,
- mode: 'no-cors',
- redirect: 'follow'
- });
- }
- componentDidMount() {
- console.log('AuthCallback componentDidMount()');
- if (/access_token|id_token|error/.test(this.props.location.hash)) {
- Auth.handleAuthentication(this.props.location.hash);
- }
- }
Add Comment
Please, Sign In to add comment