Problem with onLogin

Hi guys,
On my site code section, I have some code to handle loging-in and out.
but … there’s an issue:
On pages with a member-only permission, onLogin fails to detect signing-in events.
On pages that are open to every one, the code works as expected.
Any ideas? any workarounds?

Thanks,
J.D.

This might be tangentially related: https://www.wix.com/corvid/forum/main/comment/5cb0e1032dd82e014cec49aa

If it’s the case, Wix is aware of the issue and they’re working to resolve it but you can use some sort of subtle redirect in the meantime.

Thank you, David.
As a workaround I made it check the login status, the first time the page header gets on viewPortEnter (on member-only pages, the header gets into view port only after the user logged in). So even though, the onLogin function doesn’t work, my check detects the status.

Weird. When I posted this comment I thought it solved the issue,but now I see it didn’t.

found out why. I had to re-assign user = wixUsers.currentUser.
So this workaround seems to work.