Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS + Sockets for Authentication #98

Closed
gfyre opened this issue Apr 20, 2020 · 7 comments
Closed

CORS + Sockets for Authentication #98

gfyre opened this issue Apr 20, 2020 · 7 comments

Comments

@gfyre
Copy link
Contributor

gfyre commented Apr 20, 2020

Describe the bug
While running the entire stack, post filling up the values in.evn.development file, the whole stack loaded up, however, when an attempt is made to log into the admin dashboard, there is a CORS restriction. Please refer to the screenshot below.

To Reproduce
Steps to reproduce the behavior:

  1. docker-compose up
  2. Navigate to https://localhost:5202/
  3. login with any credentials
  4. take a look at the console logs

Expected behavior
No POST errors

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2020-04-20 at 6 37 51 PM

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Google Chrome
  • Version: Latest

Additional context
What are the default admin credentials and how do you set new ones? I went into mongodb and created a new document following the schema from https://github.com/Viveckh/Veniqa/blob/develop/management-server/database/models/user.js#L6 here.

Please assist. Thanks.

@smaharj1
Copy link
Collaborator

The CORS error is happening because your admin dashboard (localhost:5202) is trying to send a login request to shopping-server (localhost:4201). In your /management-webclient, it seems like you changed the base URL in .env files. Please put the base URL to be

VUE_APP_API_BASE_URL=https://localhost:4202/

@Viveckh can you give more info on creds.

@smaharj1
Copy link
Collaborator

Closing this issue @xtermsoft since the new changes should resolve your problems.

@gfyre
Copy link
Contributor Author

gfyre commented May 1, 2020

@smaharj1 @Viveckh I am reopening this issue since the following credentials seems to be incorrect:

Username: [email protected]
Password: pass$12

Please refer to the screenshot attached. Also, what's up with the socket connections being refused? I made the change to /management-webclient and /management-serveras mentioned in @smaharj1 's comment above. Thanks for all your help.

Screenshot 2020-05-01 at 12 09 58 PM

@smaharj1
Copy link
Collaborator

smaharj1 commented May 1, 2020

@smaharj1 @Viveckh I am reopening this issue since the following credentials seems to be incorrect:

Username: [email protected]

Password: pass$12

Please refer to the screenshot attached. Also, what's up with the socket connections being refused? I made the change to /management-webclient and /management-serveras mentioned in @smaharj1 's comment above. Thanks for all your help.

Screenshot 2020-05-01 at 12 09 58 PM

Have you tried deleting the mongo docker images and containers? And did you pull the latest?

I’ll look into socket error in a bit

@gfyre
Copy link
Contributor Author

gfyre commented May 2, 2020

Alright, so I deleted all all the old containers and installed the latest version. Now I am able to log in, however there are a few issues:

  1. I keep on getting logged out of the dashboard. After some time, it just doesn't allow me to do anything and refreshing the page logs me out.

  2. When adding arrays to the product page, the array window is not readable (please refer to the screenshot)

  3. I am not able to make changes to the existing product or add a new product but I am assuming that it is because I dont have write access to your S3 database (the console log shows CORS errors for AWS S3. Refer to the screenshot)

  4. When a new admin is added, what password would they use to log in, as I am not asked to enter a new password

Screenshot 2020-05-02 at 2 50 13 PM

Screenshot 2020-05-02 at 2 50 37 PM

Screenshot 2020-05-02 at 2 54 25 PM

Screenshot 2020-05-02 at 2 56 19 PM

Thanks alot for your help buddy! Really really appreciate it!

@smaharj1
Copy link
Collaborator

smaharj1 commented May 3, 2020

@xtermsoft

  1. You get logged out after some inactive time. It is intended.

  2. The fix is out there. Fix #106 Made changes to the UI for attributes modal not working #107 Thank you for bringing that up.

  3. For S3, you will have to point it to your own S3 buckets. We can't give the bucket access for local development. You need to create your buckets and update the info in management-server/config.json. Then, you'd need to update the URL in .env file in management-webclient too to point to your S3 bucket.

  4. Please be patient with this one. We don't have a quick fix. Currently, the new account only works with proper nodemailer and sendgrid setup. If you have already configured those, then you should navigate to management-server/.env.development and add these keys:

Screen Shot 2020-05-03 at 2 07 13 AM

You can also add these keys in your docker-compose.yml file under management-server environment variable

Note: Please open a new issue for separate issues. It is hard to track multiple issues in a closed issue

@gfyre
Copy link
Contributor Author

gfyre commented May 3, 2020

@smaharj1 Apologies for adding multiple issues into one close issue. I'll bear this in mind.

What I meant by "I keep on getting logged out of the dashboard. After some time, it just doesn't allow me to do anything and refreshing the page logs me out." is it logs me out when I am trying to do something. It all of a sudden shows me just "Catalogue" in the left-hand nav and then upon refreshing the page, I am logged out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants