Fix slash after stacker.news not required
The slash should be required else we could still redirect to external sites. For example, a site could just use "stacker.news" as a subdomain: https://stacker.news.mallory.com/
This commit is contained in:
parent
decca40c94
commit
a396933be2
|
@ -6,7 +6,7 @@ import Login from '../components/login'
|
|||
export async function getServerSideProps ({ req, res, query: { callbackUrl, error = null } }) {
|
||||
const session = await getSession({ req })
|
||||
|
||||
const regex = /^https?:\/\/stacker.news\/?/
|
||||
const regex = /^https?:\/\/stacker.news\//
|
||||
const external = !regex.test(decodeURIComponent(callbackUrl))
|
||||
if (external) {
|
||||
// This is a hotfix for open redirects. See https://github.com/stackernews/stacker.news/issues/264
|
||||
|
|
|
@ -6,7 +6,7 @@ import Login from '../components/login'
|
|||
export async function getServerSideProps ({ req, res, query: { callbackUrl, error = null } }) {
|
||||
const session = await getSession({ req })
|
||||
|
||||
const regex = /^https?:\/\/stacker.news\/?/
|
||||
const regex = /^https?:\/\/stacker.news\//
|
||||
const external = !regex.test(decodeURIComponent(callbackUrl))
|
||||
if (external) {
|
||||
// This is a hotfix for open redirects. See https://github.com/stackernews/stacker.news/issues/264
|
||||
|
|
Loading…
Reference in New Issue