Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!url.match(dataRegExp)) return;
// Extract stringified user string out of the URL
const [, data] = url.match(dataRegExp);
const decodedData = JSON.parse(decodeURI(data));
const { client } = this.props;
if (decodedData.tokens) {
await setItem('accessToken', decodedData.tokens.accessToken);
await setItem('refreshToken', decodedData.tokens.refreshToken);
await authentication.doLogin(client);
}
if (Platform.OS === 'ios') {
WebBrowser.dismissBrowser();
}
};
_handleRedirect = event => {
WebBrowser.dismissBrowser();
let data = Linking.parse(event.url);
this.setState({ redirectData: data });
};