Ilyas-Codes / eCourse

A self-hosted SPA to simplify course creation and management
https://ecourse.pockethost.io
MIT License
446 stars 33 forks source link

Fail to authenticate with Password #4

Closed Orohym closed 7 months ago

Orohym commented 7 months ago

Hello,

I tried to install eCourse with the docker-compose file provided in Issue #3. I am attempting to log in with a user created from the admin dashboard; however, it's failing. Here are the steps I have followed:

  1. Go to ipaddress:port/ to access the admin panel.
  2. Create a user. I attempted this both with and without an email (email option set to disabled).
  3. Go to ip_address:port.
  4. Click on 'Login/Get access.'
  5. Enter the user/password created in step 2.
  6. Receive error message: 'Login failed. Please check your credentials and try again.

I checked the networking tab in my browser and noticed that it's attempting to reach 'https://ecourse.pockethost.io/api/collections/users/auth-with-password' (see screenshot).

ecourse

Moreover, when I am logging in with the demo user/password, the login is successful. However, the courses I have created in the admin panel are not showing up.

Web browser : Firefox

Ilyas-Codes commented 7 months ago

The Dockerfile mentioned in the issue is outdated. I'll update it when I have the time. In the meantime, I recommend deploying it manually by following the steps in the README.

also, courses that don't have any lesson content added to them won't show up, even if they're assigned to a user. so, make sure to add at least one lesson to a course from the lessons collection for it to show up.

Ilyas-Codes commented 7 months ago

another note, there is only one user in the hosted demo (ecourse.pockethost.io) username: ilyas and password: ecourse123 obviously, if you're trying to login with different credentials, the login is going to fail.

Ilyas-Codes commented 7 months ago

wait I missed the last part, from what I understood, I think you're trying to use ecourse.pockethost.io as your own frontend and expect it to serve the data you created in the PB admin dashboard, well that's not going to work, you need to serve your own frontend locally using vite. it's all in the README.

Orohym commented 7 months ago

Ok thank you. Just to clarify, I am not trying to use ecourse.pockethost.io as front end. The deploy container is using it by "default" when I try to log in locally. As you can see in the screenshot.

grenskul commented 7 months ago

I have replicated this problem using the deployment instructions while editing the docker file. Can't login with any user I create

Ilyas-Codes commented 7 months ago

@grenskul can I see the docker file you used?

grenskul commented 7 months ago

It's not a thing yet. I'm just deploying using your instructions in the Readme.

Ilyas-Codes commented 7 months ago

did you set the VITE_PROD_PB_URL env variable?

Ilyas-Codes commented 7 months ago

@grenskul you'd need to add the URL of your hosted PB instance to VITE_PROD_PB_URL the frontend needs to know where to send the requests to.

grenskul commented 7 months ago

Same behavior . Logs show image

It looks like password login is disabled by default.

grenskul commented 7 months ago

Wait got it . had an extra EOL simbol cause of editing linux files in windows .

Ilyas-Codes commented 7 months ago

Great! I'll close the issue now.