Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: handle all auth API errors#3241

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AbhineetJain merged 7 commits intomainfromabhineetjain/auth-service-unused-errors
Jul 28, 2022

Conversation

AbhineetJain
Copy link
Contributor

@AbhineetJainAbhineetJain commentedJul 26, 2022
edited
Loading

Building on#3190, this PR handles all the remaining auth API errors:

  • getUser Will handle in a separate PR
  • checkPermissions
  • getSSHKey
  • regenerateSSHKey

Subtasks

  • display the relevant errors using theErrorSummary component.
  • add more stories for Sign in form.
  • fix unit tests for SSH Key page.
  • add stories for SSH Key page.

Makes more progress towards#3088. Leaves handlinggetUserError now.

Screenshots

getSSHKey

Screen Shot 2022-07-26 at 6 23 44 PM

regenerateSSHKey

Screen Shot 2022-07-26 at 6 37 14 PM

@AbhineetJainAbhineetJain requested a review froma team as acode ownerJuly 26, 2022 23:59
getUserError,
checkPermissionsError,
getMethodsError,
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

<ErrorSummary
error={loginErrors.checkPermissionsError}
defaultMessage={Language.checkPermissionsErrorMessage}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would DRY this up by mapping over the keys ofloginErrors

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thought about it, but we’ll have to map default messages in a separate object for that. I’ll try that!

Copy link
Contributor

@presleyppresleypJul 27, 2022
edited
Loading

Choose a reason for hiding this comment

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

I was thinking if you map over the keys you could dodefaultMessage={Language[errorKey]} if you name them the same

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Declared anenum with error types, and used aRecord<enum, Error> for iterating through keys. I was not able iterate through the properties of atype orinterface.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I was thinking of iterating overObject.keys(loginErrors).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah, that threw some error and I wasn't able to proceed.

Copy link
Contributor

@presleyppresleyp left a comment

Choose a reason for hiding this comment

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

I had some suggestions but this is awesome!

@AbhineetJain
Copy link
ContributorAuthor

@presleyp Might need some pairing help on this one, but since we are showinggetUserError in FE now, we see this when loading the home page, as the code tries to fetch the user first before prompting for log in:
Screen Shot 2022-07-28 at 5 08 47 AM

@presleyp
Copy link
Contributor

@presleyp Might need some pairing help on this one, but since we are showinggetUserError in FE now, we see this when loading the home page, as the code tries to fetch the user first before prompting for log in:Screen Shot 2022-07-28 at 5 08 47 AM

Ah, yes! There was some talk about whether it was correct that an error is thrown at this point, so I suggest checking with the backend team about whether they want it to throw, and if so I guess just don't show that one. But happy to pair.

@AbhineetJainAbhineetJain merged commit74c8766 intomainJul 28, 2022
@AbhineetJainAbhineetJain deleted the abhineetjain/auth-service-unused-errors branchJuly 28, 2022 21:14
@AbhineetJainAbhineetJain mentioned this pull requestJul 29, 2022
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@presleyppresleyppresleyp approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@AbhineetJain@presleyp

[8]ページ先頭

©2009-2025 Movatter.jp