Skip to content

Commit a148aa4

Browse files
schew2381dashed
andauthored
fix(staff): Remove incorrrect u2f error message (#70362)
Hopefully this fixes the random u2f error msg popping up when it shouldn't be --------- Co-authored-by: Alberto Leal <[email protected]>
1 parent ef82c70 commit a148aa4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

static/app/components/superuserStaffAccessForm.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ class SuperuserStaffAccessForm extends Component<Props, State> {
5959
return;
6060
}
6161

62-
await this.getAuthenticators();
62+
const authenticators = await this.getAuthenticators();
63+
this.setState({authenticators: authenticators});
64+
6365
// Set the error state if there are no authenticators and U2F is on
64-
if (!this.state.authenticators.length && !disableU2FForSUForm) {
66+
if (!authenticators.length && !disableU2FForSUForm) {
6567
this.handleError(ErrorCodes.NO_AUTHENTICATOR);
6668
}
6769
this.setState({isLoading: false});
@@ -183,10 +185,11 @@ class SuperuserStaffAccessForm extends Component<Props, State> {
183185

184186
try {
185187
const authenticators = await api.requestPromise('/authenticators/');
186-
this.setState({authenticators: authenticators ?? []});
188+
return authenticators ?? [];
187189
} catch {
188190
// ignore errors
189191
}
192+
return [];
190193
}
191194

192195
render() {

0 commit comments

Comments
 (0)