Skip to content
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

feat: export shared types for use in client/backend, update user route error to return new status code, update SettingsDto return #3504

Merged
merged 7 commits into from
Mar 2, 2022

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Feb 24, 2022

Problem

This PR is part of #3472, where types that can be shared with client/server are exported.
In addition, update user route's InvalidOtpError to return 404 instead of 401 status code, due to React app logging user out automatically when 401 is retrieved.

Also also updates the fields SettingsDto returns to:

  • Include responseMode in returned JSON
  • include publicKey field in storage mode forms

this is used to decide what fields are returned by getSettings form model method.
this means this new field will be returned by getSettings in the server for storage mode forms
this is for allowing type narrowing to happen
React code clears localStorage whenever a 401 is returned, and 404 probably works fine for an invalid OTP response (in that the given OTP has not been found in the "correct OTP" pile)
@karrui karrui changed the title feat: export shared types for use in client/backend, update user route error to return new status code feat: export shared types for use in client/backend, update user route error to return new status code, update SettingsDto return Feb 24, 2022
@karrui karrui requested review from timotheeg and mantariksh March 1, 2022 02:33
Copy link
Contributor

@timotheeg timotheeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@karrui karrui merged commit efa6028 into develop Mar 2, 2022
@karrui karrui deleted the feat/export-some-types branch March 2, 2022 16:45
@tshuli tshuli mentioned this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants