79208555

Date: 2024-11-20 18:40:48
Score: 3.5
Natty:
Report link

What is the error you encounter?

I guess that this is this part:

        // Redirect to myStockroom page after a brief delay
        setTimeout(() => {
            window.location.href = "http://127.0.0.1:5555/myStockroom"; // Use absolute URL
        }, 1500);

and your server answers that it is not possible to GET there because of @jwt_required?

If this is the case, this can be explained because the browser will not add the Authorization: header to the GET. Hence first you login, then you are redirected to /myStockroom but this request is refused by the server because it requires a JWT.

Please post console log from the browser and from the flask output to confirm this.

If this is the problem, you could add the JWT token in a cookie when /login and tell that to the decorator @jwt_required(locations='cookie'). The cookie name seems configurable with JWT_ACCESS_COOKIE_NAME and defaults to access_token_cookie.

Reasons:
  • RegEx Blacklisted phrase (2.5): Please post
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): What is the
  • Low reputation (1):
Posted by: Miaou