[openstreetmap/openstreetmap-website] no more log in the web site after configuring oauth keys

Jean-Claude Jouffre jean-claude.jouffre at univ-smb.fr
Fri Dec 2 11:08:40 UTC 2016


Hello,

The CONFIGURE.md file tell us to configure the OAuth keys in the 
config/application.yml file, by modifying default_editor and 
potlatch2_key value ... but no secret (?)

As soon as I did it, the next time I tryed to log in on 
http://127.0.0.1:3000 it failed just after clicking the Login button

NoMethodError in SiteController#index
undefined method `access_token_for_user' for nil:NilClass
Extracted source (around line #243):
241 # return an oauth access token for a specified application
242 def access_token(application_key)
243   ClientApplication.find_by(:key =>
244 end
245
246 private
Rails.root: /data/openstreetmap-website
Application Trace | Framework Trace | Full Trace
app/models/user.rb:243:in `access_token'
app/controllers/application_controller.rb:50:in `require_oauth'
config/initializers/cors.rb:9:in `call'

and quite the same message in log/development.log :

Started GET "/" for 172.17.0.1 at 2016-12-02 13:51:19 +0100
Processing by SiteController#index as HTML
   User Load (0.5ms)  SELECT  "users".* FROM "users" WHERE "users"."id" 
= $1 AND (status IN ('active', 'confirmed', 'suspended'))  ORDER BY 
"users"."id" ASC LIMIT 1  [["id", 5000000]]
   ClientApplication Load (0.5ms)  SELECT  "client_applications".* FROM 
"client_applications" WHERE "client_applications"."key" = $1 LIMIT 1
[["key", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\""]]
Completed 500 Internal Server Error in 26ms (ActiveRecord: 2.2ms)
NoMethodError (undefined method `access_token_for_user' for nil:NilClass):
   app/models/user.rb:243:in `access_token'
   app/controllers/application_controller.rb:50:in `require_oauth'
   config/initializers/cors.rb:9:in `call'

Can you please help me ?
Thanks in advance,
Jean-Claude



More information about the rails-dev mailing list