authorizerdev with nextJS not working on 12.1.0 & vanillaJS
LuD1161 opened this issue Β· comments
Hey @lakhansamani π
Awesome work with this. I've been checking your youtube tutorial for integrating this in nextJS but that seems to be not working as expected ( perhaps some SDK changes, not sure ).
Here's the timestamp of the video : https://youtu.be/2GMxfI6WUb8?list=PLSQGbUjHc6bpaAgCiQPzNxiUPr7SkDAFR&t=675
The login
button changes to logout
.
Though when I am trying, by cloning this repo and running the nextJS example, the access_token
remains in the URL bar as a query parameter
LMK, what next steps to follow.
Thanks. Regards.
A
Hey @LuD1161 ,Thank you for the input. Will let you know about the solution.
Hey, @LuD1161 I have tried but it is working for me with the same example.
@LuD1161 I have verified it,
It is happening because from screenshot I can see that you are using brave
browser which does not allow cross domain cookies, so from local host it will not allow setting cookie for demo.authorizer.dev
for this you will need to use same domain.
For testing purpose consider using chrome there it works. Else you can set insecure cookies from dashboard till development and that should fix the problem.
Also, this is happening because we have callback redirect from social media login.
I am figuring out a way to fix this for social media on sdk level.
For more info,
if you login into https://authorizer.dev it uses the same instance as of example, i.e.e demo.authorizer.dev
and as you can see there it works seamlessly which is again nextjs app.
https://github.com/authorizerdev/authorizer.dev/blob/v3/components/Hero.tsx#L132
Hey @lakhansamani @aggmoulik π
Thank you for looking into it π
- I tried on firefox as well π€
- I also have disabled the
secure
cookie option :
- Tried on chrome as well π€
Still no luck.
@LuD1161 policy is same for firefox and brave. It works for me on chrome
Can you share package.json
info, on which version of SDKs you are using.
Thanks
"@authorizerdev/authorizer-js": "1.1.0",
"@authorizerdev/authorizer-react": "1.1.0",
Interesting I tried with same version.
Can you try updating authorizer-react to 1.1.2 once.
Thanks
Other option is you can try deploying your site on heroku and try.
Okay let me try to debug more and reproduce it,
thanks for patience
Sure. LMK if you wanna hop on a all to debug this π
I am able to reproduce the issue with your instance. Checking out the heroku cookie strategy.
Seems heroku specific.
@LuD1161 can you once enable secure cookies on your instance from dashboard
@lakhansamani done ποΈ
@LuD1161 seems secure cookie + chrome combination was the issue ;-)
I did not do anything.
Once you configure right domain for app + authorizer instance it will work across all the browser.
I would do something like
xyz.com -> main app (nextjs)
auth.xyz.com -> authorizer instance.
oh okay. so as of now, this works, right ?
secure cookies - π΄ ( for brave and firefox )
and
secure cookies - π’ ( for chrome )
Yes for local development,
But if you configure right domains,
secure cookies - π’ (for brave & firefox)
Thanks a lot π π