Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-login doesn't work as expected #1839

Open
2 tasks done
jules0x opened this issue Oct 20, 2024 · 1 comment
Open
2 tasks done

Re-login doesn't work as expected #1839

jules0x opened this issue Oct 20, 2024 · 1 comment

Comments

@jules0x
Copy link

jules0x commented Oct 20, 2024

Module version(s) affected

2.2.14

Description

When a user has unsaved changes, and is idle for a period, the screen prompts for the users password.
When the user enters the password, nothing happens.
Clicking the link "refresh this page" loses the users unsaved changes,
It also shows an X at the top right, which does't do anything.

The interaction here should seamlessly refresh the session without interruption, allowing the user to continue editing or save.

Or is this the intended state?

Tested on a fresh install of silverstripe.

How to reproduce

Edit some content (e.g. HTMLEditorField).
Wait for idle timeout.
Press save.

Possible Solution

No response

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
@Cambis
Copy link

Cambis commented Nov 24, 2024

Done some investigation into this issue, it seems that the reauthentication is successful but the login modal doesn't close

How to reproduce

  1. Login to the cms
  2. Edit any page
  3. Invalidate your session (easiest way to is to delete your php session cookie)
  4. Click save
  5. See the login modal prompt, fill in details and submit
  6. See that the login modal does not close

At this point if I remove the modal from the DOM manually, I can edit and save the page as normal.

Possible solution

I'm not that familiar with how this library works but here's some ideas 😅

  1. Check to see if there are multiple react root elements? Perhaps this line references a different react root when the modal is opened vs closed?
    let root = this.getReactRoot();
  2. Investigate using onUnmountClose and onClosed props to help remove the modal see https://reactstrap.github.io/?path=/docs/components-modal--modal#props

Additional context

I can confirm that the close function is being called as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants