nodeSolidServer/solid-auth-client

Issue with Login operation

Closed this issue · 4 comments

The issue I am currently facing is I am unable to log in, I get an CORS error in my browser console.

I am using solid-auth-client bundle available here: https://github.com/solid/solid-auth-client/tree/gh-pages/dist . It has been added using rawgit.com CDN.

The snippet to javascript of my login operation is here,

// Logs in user into the Solid Pod
async function login(idp) {
  const session=await solid.auth.currentSession();
  // throws error in console
  if(!session) await solid.auth.login(idp);
  else{
    // hides the form
  idpForm.style.display="none";
   // displays logout button
  logoutButton.style.display="inline-block";
  }
}

The behavior of solid-auth-client has changed from few hours, it now re-directs to an IDP login page instead of logging me in. Earlier when using the snippet provided in docs, it would directly log me in without an redirections.

The problem is, this snippet is producing a CORS error instead of redirection.

You can view my full code here: https://github.com/pavittarx/solid-minimal
Just the Javascript file: https://github.com/pavittarx/solid-minimal/blob/master/assests/js/script.js


Errors being produced:

Failed to load https://stripe.community/.well-known/openid-configuration: Redirect from 'https://stripe.community/.well-known/openid-configuration' to 'https://discuss.stripe.community/.well-known/openid-configuration' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9227' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

image

Thanks, I will try using a bundle created from the release source, and let you know.

@RubenVerborgh The error was fixed.
It was being produced because, I was using a different domain than an IDP provider and the url was identical. I was using https://stripe.community instead of https://solid.community, in my own code.
It produced an CORS Error, and everything becomes obvious after that.
It is that, there should be a way to check if the provided URL is actually a solid server or not, which may save us time and other when we run into such an issue.

Thanks.

Great, thanks for letting us know.