Auth0 login doesnt redirect after succesful authenticate request in Electron

auth0 login doesnt redirect after succesfull authenticate request in Electron . After the /authorize request , it goes to login widget. Once user enter username and password in the widget and hits login, the widget gives an error “we are sorry, something went wrong”. In the network tab I see a succesfull /co/authenticate endpoint but no other requests. So I am stuck on the login page and it doesnt redirect, Please help. FYI, I dont use any libraries I just directly use auth0 apis in my code.

Hi @SriramSubramaniam,

Can you show us the code? Also, are you seeing a specific error code and message in your Auth0 logs?

Let me know,

export const auth0Login = () => {
  const { domain, client_id, audience, scope, redirect_uri, response_type } = auth0Options;
  const authUrl = `${domain}/authorize? audience=${audience}&scope=${scope}&response_type=${response_type}&client_id=${client_id}&redirect_uri=${redirect_uri}&prompt=login`;
  window.location = authUrl;

export const auth0Logout = () => {
  const { domain, client_id, redirect_uri_logout } = auth0Options;
  window.location = `${domain}/v2/logout?returnTo=${encodeURI(redirect_uri_logout)}&client_id=${client_id}`;

These are the functions I use for login and logout. The redirect uri here is http://localhost:8080/callback. Everything works well and redirect to http://localhost:8080/callback page works when the app is run in browser. However when run this app in electron, it gets stuck on login page with error “We are sorry, something went wrong” . As I mentioned, in the network tab I see a successful /co/authenticate post and then nothing after that. Thanks a lot for your help.

Also I dont see anything in logs in auth0. All I see is a succesful authenticate post and then nothing.

We use electron version 7

Any help please @dan.woda

Everything looks okay in your code at first glance. Did you use this tutorial to set things up:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.