fix: base_url can now have line segments as described in decaporg/dec… (#686)
Co-authored-by: alexis1987 <alexis1987@github.com>
This commit is contained in:
parent
8df0bf23ed
commit
602bb30730
@ -36,7 +36,10 @@ class Authenticator {
|
||||
cb: (error: Error | NetlifyError | null, data?: User) => void,
|
||||
) {
|
||||
const fn = (e: { data: string; origin: string }) => {
|
||||
if (e.data === 'authorizing:' + options.provider && e.origin === this.base_url) {
|
||||
if (
|
||||
e.data === 'authorizing:' + options.provider &&
|
||||
e.origin === new URL(this.base_url).origin
|
||||
) {
|
||||
window.removeEventListener('message', fn, false);
|
||||
window.addEventListener('message', this.authorizeCallback(options, cb), false);
|
||||
return this.authWindow?.postMessage(e.data, e.origin);
|
||||
@ -50,7 +53,7 @@ class Authenticator {
|
||||
cb: (error: Error | NetlifyError | null, data?: User) => void,
|
||||
) {
|
||||
const fn = (e: { data: string; origin: string }) => {
|
||||
if (e.origin !== this.base_url) {
|
||||
if (e.origin !== new URL(this.base_url).origin) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user