Project

General

Profile

User Login returns 500 internal error after API registration

Added by Christopher Schöppl over 5 years ago

Hi,

I'm trying to implement an automatic user Registration in Redmine via API/XML over PowerShell cmdlet. I'm using Bitnami stack for testing.

See my XML below:

<user>
<login>"Chris83"</login>
<firstname>"Chris"</firstname>
<lastname>"Schoep"</lastname>
<password>"toor1234"</password>
<mail>"foo@bar.com"</mail>
<auth_source_id>0</auth_source_id>
</user>

The user gets registrated and is shown in the user list in redmine (kinda weird is that the user is instantly activated but i couldn't find a flag to set the user as unactive). Anyway when im trying to Login with that user i get an internal error 500.

See my Production.log when trying to Login:

Current user: anonymous
Completed 500 Internal Server Error in 6ms (ActiveRecord: 1.2ms)

NoMethodError (undefined method `authenticate' for nil:NilClass):

app/models/user.rb:327:in `check_password?'
app/models/user.rb:227:in `try_to_login'
app/controllers/account_controller.rb:216:in `password_authentication'
app/controllers/account_controller.rb:211:in `authenticate_user'
app/controllers/account_controller.rb:38:in `login'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'


Any tips on how to solve that problem?

Thanks and Kind regards,

Chris