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

session.present vs session == nil #515

Open
MahdiSahebZamani opened this issue May 14, 2024 · 3 comments
Open

session.present vs session == nil #515

MahdiSahebZamani opened this issue May 14, 2024 · 3 comments

Comments

@MahdiSahebZamani
Copy link

Hi.
While working with lua-resty-openidc, I encountered the "request to the redirect_uri path but there's no session state found" error. I added some logs to the source code and realized that the session.present in the line returns false. Then, I added the session variable in the logs and found that it is present.
How is it possible?
I tried to comment out that if block and after that it reached this line and then returned false.
The question is what is the difference between session.present and session == nil that is in this line?

Environment
  • lua-resty-openidc version (e.g. 1.7.5)
  • OpenID Connect provider (custom OP)
Expected behaviour

session.present returns true when session is not null.

Actual behaviour

session.present returns false even if session == nil was false above.

@lexiconzero
Copy link

You've probably done what I just spent 5 hours troubleshooting..

lua-resty-session needs to be fixed at version 3.10 or lower. Default pulling latest will now work and this error was exactly what I experienced.

@MahdiSahebZamani
Copy link
Author

I think there is an inconsistency in the modules lua-resty-openidc and lua-resty-session because now I encountered a new error. That is in this line, I don't find any method with the name regenerate in lua-resty-session version 4-0-5.

@MahdiSahebZamani
Copy link
Author

You've probably done what I just spent 5 hours troubleshooting..

lua-resty-session needs to be fixed at version 3.10 or lower. Default pulling latest will now work and this error was exactly what I experienced.

That's exactly why it can't find regenerate.
Thanks.

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

No branches or pull requests

2 participants