Closed darenc9 closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
fit-future | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 19, 2024 6:22am |
fit-future-ui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 19, 2024 6:22am |
Backend-api Updates
Authentication
/src/auth
: contains 3 filesindex.js
- Determines which authentication method (cognito or basic) to use depending on environment variablescognito.js
- Implements Cognito Authentication Middleware for api routesbasic-auth.js
- Implements basic-auth middleware. Currently used for unit testsaws-jwt-verify
,http-auth
,http-auth-passport
,passport
,passport-http-bearer
Testing
tests/.htpasswd
- contains basic login credentials for unit teststests/unit/
:app
,exerciseRoutes
,profileRoutes
,workout-routes
:Frontend-ui Updates
src/components/AWS/GetToken.js
: Created this exportable function that returns the current users's JWT Token, used to get access to backend-api routesUsage
Backend basic-auth usage:
In unit tests: add
.auth('user1@email.com', 'password1')
to test responses for responses to be authorizedFrontend usage:
${process.env.API_URL}/exercises/
, {headers: {'Authorization':Bearer ${authToken}
}} );