codeprentice-org / codeprentice-site-revamped

The new Codeprentice website (currently in development).
0 stars 2 forks source link

dleamy-feat:started-jwt-implementation #1

Closed DevinLeamy closed 4 years ago

DevinLeamy commented 4 years ago

Added the begins of JWT authentication and JWT authorization middleware.

Created: backend/middleware - (folder for middleware) backend/middleware/check-auth.ts - (JWT user authorization middleware) backend/types - (folder for typescript types) backend/types/user.ts - (a user type for testing)

Changed: server.ts - (rename route "authorization" to "user" | routes should be data driven) user.ts - (added token signing to "/login" and added "/change_username" route to test middleware"

Renamed: backend/routes/authentication.ts -> backend/routes/user.ts