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

Undefined local variable or method `current_user' after upgrading to 1.6.1 #183

Open
stephenrichards opened this issue Sep 24, 2020 · 4 comments

Comments

@stephenrichards
Copy link

stephenrichards commented Sep 24, 2020

We are unable to sign out without getting this error in app/controllers/devise/saml_sessions_controller.rb:62 after upgrading from 1.5.0 to 1.6.1.

Our user is based on the Provider model, so normally we would refer to the current user as current_provider.

It seems to be happening in a before action, as it happens before it gets to the first line of this method in our controller derived from Devise::SamlSessionsController

def destroy
  sign_out current_provider
  redirect_to new_feedback_path
end

Are you able to provider some pointers as to what is going on?

@adamstegman
Copy link
Collaborator

Great catch! We are using current_user in that method as of #149. We probably need to make the current_user method configurable.

In the meantime, is SP-initiated logout working for you? That method short-circuits if the name_identifier_format is urn:oasis:names:tc:SAML:2.0:nameid-format:transient—what value are you using?

@stephenrichards
Copy link
Author

stephenrichards commented Sep 24, 2020 via email

@adamstegman
Copy link
Collaborator

Setting name_identifier_format to the value I mentioned would prevent these errors by not attempting to read the value from the current user.

For the second error, it seems like you've configured saml_session_index_key but it's not actually a valid method on your class. It seems like you can remove the line that sets that value.

@stephenrichards
Copy link
Author

OK, will take a look, 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