ketzu / rough-budget

MIT License
0 stars 0 forks source link

Cannot create Accounts / Log into Accounts #38

Closed Setmyx closed 1 month ago

Setmyx commented 1 month ago

I wanna start off by saying that this is an amazing app.

I am using the Docker Image and everything works great except for Account creation/login.

There is no feedback when pressing the register button and no feedback when pressing the login button.

Console Logs from my Browser say the following:

Uncaught (in promise) SyntaxError: Unexpected token '<', "<br />
<b>"... is not valid JSON

Docker Logs say the following: [23/Jul/2024:23:35:01 +0000] "POST /api/login.php HTTP/1.1" 200 545 "https://budget.example.net/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"

There are no errors in mysql logs

ketzu commented 1 month ago

everything works great except for Account creation/login

That is a quite huge caveout :) Thanks for the report.

I'll look into it in the coming days, but it will take some time as I am a bit busy.

ketzu commented 1 month ago

I think I figured it out, and the reason is embarassingly stupid.

...

I forgot to include the setup code, which created the tables 🙈

If you want to simply add it yourself until I get around to fix it, this should create the correct shape:

CREATE TABLE `users` (
  name varchar(255) NOT NULL,
  password varchar(255) NOT NULL,
  lastaccessed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  content mediumtext,
  PRIMARY KEY (name)
);

IF that's not the issue you face (yet), it might be the database connection itself not establishing because of hostname issues.

(There are some more issues I should fix like proper error reporting :) )

ketzu commented 1 month ago

Should be fixed with the new release.

Updated the container and some other smaller stuff (like php 7.4->8.2). If you run into trouble, please let me know :)

Maybe on another day I'll get around to update the dependencies properly.