-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVA-403 Adds authentication API #200
Conversation
@@ -1,11 +1,13 @@ | |||
const express = require('express'); | |||
const express = require("express"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier decided everything needed double quotes, will update once #198 lands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for getting this started @roryf
Can't test locally but doesn't break anything and code looks good :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roryf i have taken a look over the code changes and run the unit tests (all of which pass). I can't see anything that stands out that requires needing to be changed. I appreciate there is further work to do with Cognito going forward. Looks great work and thanks for doing this. Happy to approve.
Merging now as doesn't break existing functionality, even though new endpoints will currently fail. |
# Description Authentication services within app. Adds `AuthProvider` which is configured at app level and can be consumed in any component via `useAuth` hook. Added a placeholder example of detecting auth state in `ProfileContainer` There is an underlying `AuthClient` class which handles specific API interaction and storage of auth credentials, which uses [`expo-secure-store`](https://docs.expo.dev/versions/latest/sdk/securestore/). This also manages automatically refreshing auth tokens when access token expires, and handling transient network errors (which will happen a lot). Also configured jest correctly so we can add tests, and removed unused `app/__tests__` directory (I strongly prefer test files to sit with the file under test). Rejigged the app CI build too so it runs the tests, and lints all files not just changed (not convinced this worked correctly tbh). I would very much like to revisit the different eslintrc configs at some point, and the need for questionably useful (IMHO) file comments. Depends on backend in #200 ## Type of change Please delete options that are not relevant - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Breaking change(fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # Testing locally No user-facing features added, run the app, check nothing breaks and there are no new console warnings. # Checklist - [] My code follows the style guidelines of this project - [] I have performed a self-review of my own code - [] I have commented my code, particularly in hard-to-understand areas - [] I have removed any unnecessary comments or console logging - [] I have made corresponding changes to the documentation (if required) - [] I have addressed accessibility, if needed - [] I have followed best practices, e.g. NativeBase approaches and theming - [] I have checked the app in dark mode, if making front-end design changes - [] My changes generate no new warnings - [] I have added tests that prove my fix is effective or that my feature works - [] New and existing unit tests pass locally with my changes - [] I have updated the version numbers in `package.json` files in the [app](DEPLOYMENT.md#app-deployment) and/or [api](DEPLOYMENT.md#api-deployment-on-aws) directories as needed
Description
https://sta2020.atlassian.net/browse/SVA-403
Adds
/auth
endpoints to support Cognito-based authentication in the app.Requires config updates to set Cognito env vars, depends on setting up Cognito correctly.
Type of change
Please delete options that are not relevant
Testing locally
Won't currently work locally or otherwise...
Checklist
package.json
files in the app and/or api directories as needed