Skip to content

Commit

Permalink
fix: removes username and password from NodeAuthRequiredPopup (#5570)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeanribeiro committed Jan 13, 2023
1 parent e84b096 commit ed2606e
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions packages/shared/components/popups/NodeAuthRequiredPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,21 @@
let isBusy = false
let username: string
let password: string
let jwt: string
let usernameError: string
let passwordError: string
let jwtError: string
$: disabled = (!username && !password && !jwt) || isBusy
$: disabled = !jwt || isBusy
async function handleSubmit(): Promise<void> {
try {
isBusy = true
const auth = { username, password, jwt }
const auth = { jwt }
await onSubmit(auth)
isBusy = false
} catch (err) {
isBusy = false
const authenticationError = err?.error?.match(/(username)|(password)|(jwt)/g)?.[0]
const authenticationError = err?.error?.match(/(jwt)/g)?.[0]
switch (authenticationError) {
case 'username':
usernameError = err.error
break
case 'password':
passwordError = err.error
break
case 'jwt':
jwtError = err.error
break
Expand All @@ -50,18 +39,6 @@
<Text type={TextType.h3} classes="mb-6">{localize('popups.nodeAuthRequired.title')}</Text>
<Text fontSize="15">{localize('popups.nodeAuthRequired.body')}</Text>
<div class="flex flex-col w-full space-y-4 mt-4">
<TextInput
bind:value={username}
bind:error={usernameError}
placeholder={localize('general.username')}
label={localize('general.username')}
/>
<TextInput
bind:value={password}
bind:error={passwordError}
placeholder={localize('general.password')}
label={localize('general.password')}
/>
<TextInput
bind:value={jwt}
bind:error={jwtError}
Expand Down

0 comments on commit ed2606e

Please sign in to comment.