Giter VIP home page Giter VIP logo

Comments (8)

GDay avatar GDay commented on June 12, 2024

On what page do you visit the site? This usually happens when the frontend and backend urls are mixed (i.e. localhost and 0.0.0.0 or 127.0.0.1). You should visit the frontend on the same url as the backend (only difference should be the port number), otherwise the cookies are not set and therefore all requests after login will fail.

Does that fix it?

from chiefonboarding.

gruberdev avatar gruberdev commented on June 12, 2024

It didn't work because if I were to configure the backend and the frontend to use HOST=127.0.0.1 the application doesn't know how to communicate to outside of Docker using Macintosh network driver.

If you try to use the default configuration the URIs don't match, as in, I can't access the application using 0.0.0.0 either.
I think that I can reconfigure my DNS configuration to force connection to localhost when trying to connect to that IP configuration, I'll try that and report here afterward.

from chiefonboarding.

GDay avatar GDay commented on June 12, 2024

I have been able to run the application and use 0.0.0.0:8000 (backend) and 0.0.0.0:3000 (frontend). Which of the two doesn't work on that url for you? Do neither work?

If you want to use 127.0.0.1 then you probably only have to change this line: https://github.com/chiefonboarding/ChiefOnboarding/blob/master/front/nuxt.config.js#L77

Change 0.0.0.0:8000 to 127.0.0.1:8000 there and then restart docker.

from chiefonboarding.

douglampe avatar douglampe commented on June 12, 2024

I'm running into the same issue. I am running in docker on EC2 in AWS behind an ALB. I am able to get to the login screen using the public IP of the ELB. When I log in, I get the same behavior (login is successful, but accessing the detail page returns 403 so I get sent back to the login. Is there a way to get debug logging via docker so I can see the details of the error? I'm not seeing anything in the log.

from chiefonboarding.

GDay avatar GDay commented on June 12, 2024

Don't think there is a way in Docker to find out.

Have you tried to refresh the page? Also, can you check that the frontend and backend are running on the same URL? With that, including the http(s) it should be exactly the same domain name otherwise it will fail for the page you are visiting and where the requests are being made to.

from chiefonboarding.

douglampe avatar douglampe commented on June 12, 2024

I'm just testing so using the ALB IP address but yes, I have it with HTTP in BASE_URL and also ALLOWED_HOSTS (which also has the private IP since this is what the ALB is using). Also, I'm not using caddy since I'm using an ALB which should be doing the same thing (routing from the external address to the docker server:port).

from chiefonboarding.

GDay avatar GDay commented on June 12, 2024

I'm just testing so using the ALB IP address

That's likely your issue. I assume that doesn't have an SSL certificate. You will need to disable this:

if not env('DEBUG', default=False) and not env('HTTP_INSECURE', default=False):
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

Basically, setting HTTP_INSECURE to True in your environment settings.

from chiefonboarding.

GDay avatar GDay commented on June 12, 2024

Chief is now not using two servers anymore (node + Django -> Django only), so this issue should be gone too (if this was still relevant).

from chiefonboarding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.