We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does LAZO support blocking off-site redirects via config or only allow redirect from a whitelist via a config?
Or that is something outside of framework scope?
The text was updated successfully, but these errors were encountered:
That would something that you put in a filter so that when LAZO.app.navigate is called you can redirect to another page.
LAZO.app.navigate
Sorry, something went wrong.
here is the solution. you can do something like to only allow redirect within current site
LAZO.app.addRequestFilter('.*', function (path, params, ctx, options) { var hostname = ctx.location.hostname; var port = ctx.location.port; var sslPort = LAZO.config.get('sslPort') || 8443; var sslProtocol = LAZO.config.get('sslProtocol') || 'https'; var hostMatchPattern; var redirectHost; var redirectUrl; hostMatchPattern = port ? hostname + ':' + port : hostname; redirectHost = getHostName(ctx.params.redirect); if (!(redirectHost === hostMatchPattern)) { //redirect to main host page return options.success(sslProtocol + '://' + hostname + (sslPort ? ':' + sslPort : '')); } }); function getHostName(url) { var regex = /^(?:https?:\/\/)?(?:www\.)?([^\/]+)/i; var redirectHostMatch = url.match(regex); var redirectHost; if (redirectHostMatch) { redirectHost = redirectHostMatch[1]; } return redirectHost; }
No branches or pull requests
Does LAZO support blocking off-site redirects via config or only allow redirect from a whitelist via a config?
Or that is something outside of framework scope?
The text was updated successfully, but these errors were encountered: