sonatype-nexus-community / nexus-iq-chrome-extension

Chrome extension for use with Sonatype Nexus Lifecycle - IQ server
https://sonatype-nexus-community.github.io/nexus-iq-chrome-extension/
Apache License 2.0
20 stars 12 forks source link

[BUG]: Login button does not validate correctly #196

Closed ctunited15 closed 1 year ago

ctunited15 commented 2 years ago

Clicking the login, gives the message "Login Successful", but when saving, it errors out. It is easy to test by entering the wrong username / pw.

The problem is that I am already logged in and the cookie is still there. It should be invalidated.

madpah commented 1 year ago

There is definitely some issue in this space still on v2.x.x branch @maurycupitt.

We do not allow empty fields 👍 , but invalid login information does not provide any user feedback or errors?

Screenshot 2023-05-19 at 13 26 17

Screenshot 2023-05-19 at 13 26 48

madpah commented 1 year ago

Initial root cause is this line:

const loggedIn = await requestService.loginViaRest();

as this does not return true/false upon success/failed login - true implies the request was made successfully, not that it received an acceptable response.

This is an example of the use of internal REST APIs, which we should avoid.

madpah commented 1 year ago

We should move towards https://www.npmjs.com/package/@sonatype/nexus-iq-api-client

madpah commented 1 year ago

Turns out that because this call is to an internal /rest API, it uses COOKIE if it is there and avoids the actual credentials enters.

Looks like #267 now becomes more important...

madpah commented 1 year ago

Resolved now in v2.x.x branch.