Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
build(path: string = '/'): string {
if (!this.fastboot.isFastBoot) {
return `${window.location.protocol}//${window.location.host}${path}`;
}
const request = this.fastboot.request;
// NOTE: On Heroku, `request.get('protocol')` returns `"http:"`
// even if it’s an HTTPS request, so we can’t use it.
const protocol = config.APP.FORCE_SSL ? 'https:' : 'http:';
return `${protocol}//${request.host}${path}`;
}
}
beforeModel(transition) {
let newDynObject = {};
let thisRouteName = this.routeName;
let routeNames = this.router._routerMicrolib.recognizer.names;
let dynSegsOfNextRoute = null;
let dynSegsOfThisRoute = null;
// If the redirect route is not a valid route name in this app AND then redirect
// looks like a url, send um that-a-way via location.replace
if (!routeNames[options.redirect] && resemblesURL(options.redirect)) {
transition.abort();
window.location.assign(options.redirect);
return false;
}
dynSegsOfNextRoute = getDynamicSegments(routeNames[options.redirect].segments);
dynSegsOfThisRoute = getDynamicSegments(routeNames[thisRouteName].segments);
// Make sure we only try to make a redirect at the most nested
// route and not a parent resource.
if(this.routeName !== transition.targetName) {
return false;
}
// Make sure that the lengths are the same else we are trying to transition to a route that needs more
// segments then we can supply.
if(dynSegsOfNextRoute.length <= dynSegsOfThisRoute.length) {
redirect(url) {
window.location.href = url;
},
assign(location: string): void {
window.location.href = location;
}
}
sort_by: 'name',
'repository.managed_by_installation': false,
'repository.active': true,
custom: {
owner: this.owner.login,
type: 'byOwner',
},
};
let repositories = yield this.store.paginated('repo', queryParams, { live: false }) || [];
yield fetchAll(this.store, 'repo', queryParams);
let githubQueryParams = repositories.map(repo => `repository_ids[]=${repo.githubId}`).join('&');
window.location.href =
`https://github.com/apps/${appName}/installations/new/permissions` +
`?suggested_target_id=${this.owner.githubId}&${githubQueryParams}`;
})
});