matcha-devs / matcha

A comprehensive web-based personal finance tracker and budgeting tool.
6 stars 0 forks source link

Fixed uneven handler setup in routers.go allowing for timeout on user requests for public resopurces. #3

Closed CarlosACJ55 closed 3 months ago

CarlosACJ55 commented 3 months ago

Purpose

Completed TODO(@CarlosACJ55): Improve handling of entry points. @seoyoungcho213 : Implemented cookie after login

Usage

Same run as usual. User should see no difference.

Changes

@CarlosACJ55 Refactored an new global and handler for public resources. Then served it withClientTimeout like all other handlers. Refactored users structure to be visible from internal packages. Added unit tests for new database APIs Modified user verification to return user id and save unnecesary querying

@seoyoungcho213 Implemented cookie after login

Rationale

@CarlosACJ55 Were part of a TODO, were necessary improvements to get closer to completing the users management.

@seoyoungcho213 Implementing cookies & sessions

Dependencies

N/A

Issues and Bugs

Sign up redirects still don't work.

Unit tests really need to be more ppurposeful when using t.Fatal vs t.Error, must look over this file in the future

Currently using sprintf for a lot of queries, if we do this we must create tables of allowable values, then check our inuts to sprint before running any queries

Possible Solutions

If the login button is causing mad warinings, make sure to drop ur old schema!

Fix sign-up handler

Additional Notes

None

Contributors:

@CarlosACJ55, @seoyoungcho213 Name and what they did: All


Checklist before submitting

Alishah634 commented 3 months ago

Other than the 2 bugs that were found and can be fixed in the next update this PR is good to go, and adds the required feature. Good work @CarlosACJ55 @seoyoungcho213