Users are reporting an issue with the SSO plugin in Discourse where visiting a direct user message link (e.g., /users/{username}/messages) results in the error “Account login timed out, please try logging in again.” Interestingly, reloading the same link often succeeds, suggesting Discourse only triggers the SSO flow on the second attempt — not immediately when the session expires. depeters questions why the SSO redirect isn’t called upfront, noting this behavior didn’t occur in older versions. fefrei acknowledges the issue and references a prior suggestion to fix it, though they aren’t personally affected. Others, like ramanbuttar and Denis_Heraud, confirm the problem and highlight its poor UX — users must reload the page to log back in. depeters found a workaround by scaling down to a single container to avoid state loss across containers. matveychuk initially struggled with the same error but resolved it by fixing a React app bug: their SSO redirect was firing twice in componentDidUpdate, causing the nonce to expire on the second attempt — even though the user was technically logged in. Benny also reports sporadic occurrences of the issue, seeking a reliable solution. The consensus is that this behavior is confusing and needs to be fixed in Discourse core to improve user experience.
If it has been a while since visiting that link the user will get “Account login timed out, please try logging in again.” If I visit the exact link again, the user is successfully logged in and I do not receive the error message. My question is: if the account login is timed out, why doesn’t the discourse system go ahead and call my external sso url like it does the second time? It’s as if, first, the user has to attempt going to a url in discourse and get the error message. Discourse notices and saves some setting. The second time, discourse knows the user is logged out and correctly calls the sso flow. Why can’t it immediately call the sso flow and skip the “Account login timed out” error? In fact, it seems in previous versions of Discourse I did not have this problem.
I was running multiple containers taking SSO requests. I was retaining a bit of state between requests and if a single user jumped between containers, I lost the state I needed and received the error. Temporarily I scaled down to one container.
I’ve just add discourse forum to my web site and enable sso-login. Users have this error on every new login try while login takes 5-10 seconds not 10 min. After clicking my logo or reload the page user is logged in. Please advice how to solve this problem. It’s bad UX and confusing for users
I’ve fixed it. The problem was the next:
My client is react app and the redirect to forum with payload to log in is located in componentDidUpdate lifecycle method of some high-order component. For every login attempt this redirect was fired twice - so first one was successful, while the second one with the same nonce got error because nonce was already expired after the first one. As a result user actually was logged in but saw the error “Account login timed out, please try logging in again”