Kong / Kong/insomnia

Switching Authentication method loses existing settings

Open
#6,369 1 comment 0 reactions 0 assignees View on GitHub
B-bug S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

Starting with a selected authentication method (for example Basic Auth) and having filled any authentication related field (for example USERNAME: test), switching to a different authentication method with a different set of fields (for example Bearer Token) triggers the dialog to warn about potential loss of current authentication settings.

When the dialog

> Switch Authentication?
>
> Current authentication settings will be lost
> [Cancel] [Ok]

appears, it should be possible to press the Cancel button and stay with the previous authentication method and not lose any of the filled out data of that authentication method.

### Actual Behavior

When switching authentication method, while the "Switch Authentication?" dialog pops up, the new authentication method is already opened and there is no difference between pressing Ok or Cancel.

The previously entered authentication data are lost and need to be re-entered when switching back to the previous authentication method.

### Reproduction Steps

1. Create or open a http request
2. Click on "Auth" and select "Basic Auth"
3. Enter "test" into the Username field
4. Click on the auth selection (now named "Basic") and select "Bearer Token"
5. Popup opens, in error case
- The authentication method changes even when trying Cancel on the dialog
- There is no way to go back to "Basic Auth" with filled Username "test", without re-entering the value manually

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

_No response_

### Insomnia Version

2023.5.6

### What operating system are you using?

Windows

### Operating System Version

Windows 10.0.19045

### Installation method

insomnia.rest download

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the Auth selector using the listed Basic Auth and Bearer Token steps, then inspect the authentication method switch and confirmation dialog entry points. Done means Cancel keeps Basic Auth selected with the entered username, while Ok switches methods and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.