Skip to content

Commit 2a54729

Browse files
committed
Bugfix sudo useEffect
1 parent e313240 commit 2a54729

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/terminal/Terminal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Terminal = (
5555

5656
useEffect(() => {
5757
const passwordPrompt = emulatorState.getPasswordPromptState();
58-
if (passwordPrompt) {
58+
if (passwordPrompt && !passwordPrompt.loading) {
5959
authenticateWithPasskey(emulator, emulatorState);
6060
}
6161
}, [emulatorState.getPasswordPromptState()]);

src/javascript-terminal/commands/sudo.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ export const authenticateWithPasskey = async (
5353
if (!promptState) return;
5454

5555
try {
56-
emulatorState.setPasswordPromptState({ ...promptState, loading: true });
5756
const { data: authOptions } = await axios.post(`${API_URL}/admin/passkey-auth-options`);
5857

58+
emulatorState.setPasswordPromptState({ ...promptState, loading: true });
59+
5960
const authResponse = await startAuthentication({ optionsJSON: authOptions });
6061
const { data: authResult } = await axios.post(`${API_URL}/admin/passkey-auth`, {
6162
response: authResponse,

0 commit comments

Comments
 (0)