Closed mbwatson closed 4 years ago
Thanks for the report @mbwatson - something I didn't consider - big oversight! I'll put up a patch over the weekend.
That's great! Thanks for your prompt response, too!
I really love having this plugin, so please let me know if I can assist in any way.
@mbwatson - Just released 1.1.1
which checks for a valid selector before running the scroller. Thanks for catching it mate.
@brohlson Awesome, the update prevents crashing. I do, however, see a warning in the console: Anchor Links plugin attempted to scroll to an invalid hash on route change
if that's a concern to address.
@brohlson Awesome, the update prevents crashing. I do, however, see a warning in the console:
Anchor Links plugin attempted to scroll to an invalid hash on route change
if that's a concern to address.
I added this. I think it's a pretty valid warning considering how edgy this case feels.
I'm attempting to integrate a Gatsby app with an external authentication tool that uses OIDC. As is typical, I link over to the external provider's login page, enter credentials, log in, then that page authenticates the user, and sends them back via the redirect URI, which contains a bunch of hash parameters,
token_type
,id_token
, etc.Because they're coming in as hash parameters (
https://domain.com/page/#token_type=Bearer&id_token=eyJ...Y1st5OQ
), and not query parameters (https://domain.com/page/?token_type=Bearer&id_token=eyJ...Y1st5OQ
), there is a conflict with this plugin.It seems to want to check the DOM for an element with an ID given by the hash string appended to the redirect URL. The error
is thrown, and the application crashes.
Could this plugin safely navigate this error?