-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(u2f): Enable renaming u2f device #29263
Conversation
static/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx
Outdated
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx
Outdated
Show resolved
Hide resolved
if (id !== 'u2f' || !isEnrolled) { | ||
return null; | ||
} | ||
class U2fEnrolledDetails extends React.Component<Props, State> { |
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.
Instead of making this a React.Component can we useState
for any state it needs?
size-limit report
|
device["name"] = request.data.get("name") | ||
authenticator.save() | ||
|
||
return Response(status=status.HTTP_201_CREATED) |
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.
Status 201 means that we've newly created an object at a URI that the response provides. I believe 204 is correct here.
context={"authenticator": authenticator}, | ||
send_email=True, | ||
) | ||
return Response(serialize(interface)) |
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.
The "if" and "else" bodies are independent modes of the endpoint. Let's extract both to their own helper methods.
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.
Sounds good, ill move it into their own helper methods, but I would still need to keep the if and else right? I don't want to regenerate the recovery code if i want to rename it
… changed response codes
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Outdated
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Outdated
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Outdated
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Outdated
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Outdated
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx
Show resolved
Hide resolved
static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx
Outdated
Show resolved
Hide resolved
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.
👍
Allow user to rename their u2f device after being registered.
As stated in user_authenticator_details, put has been updated to rename a device's name. This put endpoint is temporary for now as we look for a new home for the parts about regenerating recover codes
https://getsentry.atlassian.net/browse/ER-641