Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createAuthRedirectUrl = (authUrl: string): string => {
const { protocol, hostname, port } = url.parse(__WEBSITE_URL__);
// Both iOS Simulator and Node backend on iOS use localhost, so no need to use nip.io in this case
const expoHostname = hostname === 'localhost' ? `localhost` : `${url.parse(Constants.linkingUrl).hostname}.nip.io`;
const urlHostname = __DEV__ ? expoHostname : hostname;
return `${protocol}//${urlHostname}${port ? ':' + port : ''}${authUrl}?expoUrl=${encodeURIComponent(
Constants.linkingUrl
)}`;
};
const createAuthRedirectUrl = (authUrl: string): string => {
const { protocol, hostname, port } = url.parse(__WEBSITE_URL__);
// Both iOS Simulator and Node backend on iOS use localhost, so no need to use nip.io in this case
const expoHostname = hostname === 'localhost' ? `localhost` : `${url.parse(Constants.linkingUrl).hostname}.nip.io`;
const urlHostname = __DEV__ ? expoHostname : hostname;
return `${protocol}//${urlHostname}${port ? ':' + port : ''}${authUrl}?expoUrl=${encodeURIComponent(
Constants.linkingUrl
)}`;
};
it('should have other props', () => {
(Constants.deviceId: ?string);
(Constants.linkingUrl: ?string);
});
export default function buildRedirectUrlForMobile(authType) {
const { protocol, hostname, port } = url.parse(__WEBSITE_URL__);
const expoHostname = `${url.parse(Constants.linkingUrl).hostname}.nip.io`;
const urlHostname = __DEV__ ? expoHostname : hostname;
return `${protocol}//${urlHostname}${port ? ':' + port : ''}/auth/${authType}?expoUrl=${encodeURIComponent(
Constants.linkingUrl
)}`;
}
export default function buildRedirectUrlForMobile(authType) {
const { protocol, hostname, port } = url.parse(__WEBSITE_URL__);
const expoHostname = `${url.parse(Constants.linkingUrl).hostname}.nip.io`;
const urlHostname = __DEV__ ? expoHostname : hostname;
return `${protocol}//${urlHostname}${port ? ':' + port : ''}/auth/${authType}?expoUrl=${encodeURIComponent(
Constants.linkingUrl
)}`;
}