1
0
Fork 0
forked from OpenNeo/impress
impress/config/initializers/openneo_auth.rb
Matchu 0d6caceb24 improve app infrastructure to make a dev environment easier to reproduce
This commit will require a few changes to the deployment process:
* store AWS credentials in AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars
* store OpenNeo Auth credentials in OPENNEO_AUTH_APP, OPENNEO_AUTH_SERVER, and OPENNEO_AUTH_SECRET env vars

STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY are now required, too; better have a good .env.
You can always put in dummy values if you have no credentials, though; they only get called up if there's a transaction.

SECRET_TOKEN is now an env var, too, but the production deploy process currently replaces config/initializers/secret_token.rb anyway; this might be the way to go later, though.
2015-07-16 17:44:52 -04:00

15 lines
397 B
Ruby

require 'openneo-auth'
Openneo::Auth.configure do |config|
config.app = ENV.fetch('OPENNEO_AUTH_APP')
config.auth_server = ENV.fetch('OPENNEO_AUTH_SERVER')
config.secret = ENV.fetch('OPENNEO_AUTH_SECRET')
config.remote_auth_user_finder do |user_data|
User.find_or_create_from_remote_auth_data(user_data)
end
config.remember_user_finder do |id|
User.find_by_id(id)
end
end