HackGT / SponsorshipPortal

[in development] Web interface for sponsors to view participant information. Integrates with HackGT/registration
GNU General Public License v3.0
7 stars 0 forks source link

User authentication middleware/controller #57

Closed bunsenmcdubbs closed 6 years ago

bunsenmcdubbs commented 6 years ago

Relevant routes from #58 (to be finalized):

Route Method Description Request Response
/user PUT Create a new user {email: <string>, password: <string>, org_id: <id>} {token: <JWT>}
/user/login POST Login and authenticate {email: <string>, password: <string>} {token: <JWT>}

blue-jay/blueprint is a good template for MVC golang servers. I've used as a reference to structure a much of this project. In particular, something like https://github.com/blue-jay/blueprint/blob/master/middleware/acl/acl.go would probably be the way to go.

This middleware would be selectively applied to routes by wrapping around the route's http.Handler similar to how it works for the logging and recovery middleware https://github.com/HackGT/SponsorshipPortal/blob/master/server/routes.go#L26-L27