-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
pr05 Typescript Migration #14: Migrate User Controller #3681
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
Open
clairep94
wants to merge
68
commits into
processing:develop
Choose a base branch
from
clairep94:pr05/migrate_user_controller_oct
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
dcae2b7
package.json: add @types/express
clairep94 e4e759c
Merge with develop
clairep94 fbccc7d
server/utils/isAuthenticated: update to ts, no-verify
clairep94 a84bf81
server/utils/isAuthenticated: update to named export & add Express ty…
clairep94 7a61ed3
server/routes/user.routes: organise routes into subdomains
clairep94 d8435a4
isAuthenticated: add test for middleware
clairep94 f62e9c4
move isAuthenticated to /server/middleware folder
clairep94 eae9ca6
server/controllers/user.controller/apiKey.test: migrate to ts, no-verify
clairep94 b19d61f
server/controllers/user.controller/apiKey.test: resolve type-errors
clairep94 c2ea2b1
server/controllers/user/apiKey: migrate to ts, no-verify
clairep94 8848ed5
types/express: add AuthenticatedRequest type, no-verify
clairep94 548e345
correctly extend the Express User interface with custom properties
clairep94 6ab4b3d
server/controllers/user.controller: finish typing request and respons…
clairep94 3f012dd
server/controllers/user.controller: Add tests for signup routes
clairep94 f4997b6
user controller: migrate relevant routes to /signup
clairep94 5c2e5d9
create user.controller/helpers.js
clairep94 d293ee7
controllers/user/helper: add tests and update to ts
clairep94 f8a7891
migrate emailVerificationInitiate to user.controller/signup & add tests
clairep94 e0e2aa3
server/controllers/user.controller/signup: update to ts, no-verify
clairep94 fff6e51
server/controllers/user.controller/signup: add response and request t…
clairep94 238f545
server/controllers/user.controller/userPreferences: add test for upda…
clairep94 df35eb4
server/controllers/user.controller/userPreferences: move updateUserPr…
clairep94 c455dd6
server/controllers/user.controller/userPreferences: add test for upda…
clairep94 6708adb
user controller tests: correct names in top-level describe
clairep94 2350199
user controller: add 3rd party auth management tests
clairep94 1afa044
user controller/auth management: migrate unlinkGithub and unlinkGoogl…
clairep94 85ef277
fix usercontroller helpers test
clairep94 13403dd
add test for resetPasswordInitiate
clairep94 f475d5a
migrate resetPasswordInitiate to /authManagement and add req res types
clairep94 d61ef5f
user controller: validResetPasswordToken, add test
clairep94 93695ad
user controller: validateResetPasswordToken, migrate to /authManageme…
clairep94 b82f974
add test for user.controller updateSettings
clairep94 c7cd791
user.controller/authManagement tests: re-organise with clearer describes
clairep94 12a98d9
user.controller updatePassword: add tests
clairep94 498cfe4
user.controller updatePassword: migrate to /authManagement, add req a…
clairep94 e845914
updateSettings: migrate to /authManagement, add req and res types, no…
clairep94 544bcb9
user.controller: migrate userExists to helpers & clean up file
clairep94 c496b67
migrate user.controller file into index file
clairep94 08fccf7
migrate types for userPreferences to types folder
clairep94 5fadd83
migrate types for user controller/signup to types folder
clairep94 2c14442
migrate types for usercontroller/apikey to types folder
clairep94 2e1bbe4
migrate tpyes for usercontroller/authManagement to types folder
clairep94 ea92905
add helper type in types/express to simplify defining route params
clairep94 3bce71f
fix logic in updateSettings to resolve type error, nest the currentPa…
clairep94 ea21fc1
add test util to create mockUser for typesafety
clairep94 33aa06b
add jsdocs to userController.signup routes
clairep94 57d38f7
add jsdocs to userController.userPreferences routes
clairep94 6332a45
update user.password to be optional per mongoose schema
clairep94 e8dcb59
add jsdocs to userController.authManagement routes
clairep94 3d78cdc
add jsdocs to userController.apiKey routes
clairep94 eeaa29a
add remaining tests for helpers
clairep94 0138eb2
uncomment failing tests for authManagement
clairep94 84396ed
user.controller/userPreferences: update request body type to Partial<…
clairep94 eb2fc4f
fix helpers tests
clairep94 bf9626e
fix updatePassword test
clairep94 df63907
clean up userPreferences test
clairep94 f78a692
clean up apiKey test
clairep94 47015cd
clean up authManagement tests
clairep94 b0548ea
split up authManagement tests into sub files for easier reading
clairep94 fd98175
clean up tests by migrating frequent mocks to mock files
clairep94 e46db9b
resolve updateSetting tests with current logic
clairep94 1426142
cleanup jsdocs
clairep94 b492d3e
user.controller/authManagement: update tests for updateSettings to be…
clairep94 60bb02a
update tests to correct typos
clairep94 f8fe2de
fix typo
clairep94 e7730d6
stronger typing on userResponse
clairep94 7eeac88
extend Request type for jest-express
clairep94 509e00a
server/controller/user: update tests to have stronger typing for requ…
clairep94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Migrated this to a barrel structure based on the 'subdomain' of what each route is for, please see
server/routes/user
Made sure to add unit tests to each item prior to migrating & did not change any logic within functions other than asserting
req.user!
on authenticated routes