Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Cannot mass assign login #29

Open
danielamkaer opened this issue Jul 11, 2017 · 2 comments
Open

Cannot mass assign login #29

danielamkaer opened this issue Jul 11, 2017 · 2 comments

Comments

@danielamkaer
Copy link

I needed this in plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml/user_patch.rb
to prevent an issue with mass assignment:

    user = new user_attributes.except(:login)
    user.created_by_omniauth_saml = true
    user.login    = user_attributes[:login]

error:
Current user: anonymous
WARNING: Can't mass-assign protected attributes for User: login
plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml/user_patch.rb:12:in find_or_create_from_omniauth' plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml/account_controller_patch.rb:32:in login_with_saml_callback'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Completed 422 Unprocessable Entity in 11ms (ActiveRecord: 5.7ms)

@chrodriguez
Copy link
Owner

Which redmine version are you using?

@danielamkaer
Copy link
Author

Installed using apt on ubuntu 16.04

Environment:
Redmine version 3.2.1.stable
Ruby version 2.3.1-p112 (2016-04-26) [x86_64-linux-gnu]
Rails version 4.2.6
Environment production
Database adapter Mysql2

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

No branches or pull requests

2 participants