Skip to content

Feat/login url handling and errors#52

Merged
Ldoppea merged 3 commits into
masterfrom
feat/login_url_handling_and_errors
Dec 2, 2021
Merged

Feat/login url handling and errors#52
Ldoppea merged 3 commits into
masterfrom
feat/login_url_handling_and_errors

Conversation

@Ldoppea
Copy link
Copy Markdown
Contributor

@Ldoppea Ldoppea commented Nov 22, 2021

This PR:

  • Add CozyURL sanitization (remove slug, ensure scheme, remove trailing slashes etc)
  • Fix HTTP error messages handling
    • cozy-slack error format differs from Bitwarden's one so we need to add a custom parser
    • ⚠️ current implementation is pretty simple and may need to be improved it in the future if more complex messages can be received from stack
  • Add a custom popup in case of 401 message from stack during login phase
    • ❓ Can we suppose a 401 error must be an invalid login/password from the user? Or should we specify a more generic message?

@Ldoppea Ldoppea requested a review from Crash-- as a code owner November 22, 2021 19:11
@delete-merged-branch delete-merged-branch Bot deleted the branch master November 26, 2021 12:18
@Ldoppea Ldoppea force-pushed the feat/login_url_handling_and_errors branch 2 times, most recently from f06e432 to 60520fc Compare November 29, 2021 16:44
@Ldoppea Ldoppea changed the base branch from fix/import_vault to master November 30, 2021 14:34
Comment thread src/App/Pages/Accounts/LoginPageViewModel.cs
Comment thread src/App/Resources/AppResources.fr.resx Outdated
Comment thread src/App/Resources/AppResources.fr.resx
Copy link
Copy Markdown
Contributor

@Crash-- Crash-- left a comment

Choose a reason for hiding this comment

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

except translation strings, 👍

Sanitize Cozy url before login

Display a user friendly exception in case of badly formated Cozy url
CozyStack error messages do not fit Bitwarden's errors format so we
have to create a custom parser for them
As the stack does not translate error messages and 401 is the most
common error then we intercept this specific error to translate it on
client side
@Ldoppea Ldoppea force-pushed the feat/login_url_handling_and_errors branch from 60520fc to 9ffea65 Compare November 30, 2021 16:25
@Ldoppea Ldoppea merged commit 81dbc33 into master Dec 2, 2021
@delete-merged-branch delete-merged-branch Bot deleted the feat/login_url_handling_and_errors branch December 2, 2021 16:27
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.

3 participants