Skip to content

Commit

Permalink
Merge pull request #40 from marians/patch-1
Browse files Browse the repository at this point in the history
Fix env variable name in error message to `ORIGIN`
  • Loading branch information
vencax authored Feb 19, 2024
2 parents 9fb04e4 + e70674f commit 0844c3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions login_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const REQUIRED_ORIGIN_PATTERN =
/^((\*|([\w_-]{2,}))\.)*(([\w_-]{2,})\.)+(\w{2,})(\,((\*|([\w_-]{2,}))\.)*(([\w_-]{2,})\.)+(\w{2,}))*$/

if (!process.env.ORIGINS.match(REQUIRED_ORIGIN_PATTERN)) {
throw new Error('process.env.ORIGIN MUST be comma separated list \
throw new Error('process.env.ORIGINS MUST be comma separated list \
of origins that login can succeed on.')
}
const origins = process.env.ORIGINS.split(',')
Expand Down Expand Up @@ -44,4 +44,4 @@ module.exports = (oauthProvider, message, content) => `
console.log("Sending message: %o", "${oauthProvider}")
window.opener.postMessage("authorizing:${oauthProvider}", "*")
})()
</script>`
</script>`

0 comments on commit 0844c3b

Please sign in to comment.