forked from External/greenlight
add ability to configure terms and conditions
This commit is contained in:
@ -5,5 +5,4 @@ test:
|
||||
adapter: test
|
||||
|
||||
production:
|
||||
adapter: redis
|
||||
url: redis://localhost:6379/1
|
||||
adapter: async
|
||||
|
9
config/initializers/terms.rb
Normal file
9
config/initializers/terms.rb
Normal file
@ -0,0 +1,9 @@
|
||||
# Load terms and conditions.
|
||||
|
||||
terms = "#{Rails.root}/config/terms.txt"
|
||||
|
||||
Rails.configuration.terms = if File.exist?(terms)
|
||||
File.read(terms)
|
||||
else
|
||||
false
|
||||
end
|
@ -11,14 +11,16 @@ Rails.application.routes.draw do
|
||||
|
||||
# User resources.
|
||||
scope '/u' do
|
||||
get '/:user_uid/edit', to: 'users#edit', as: :edit_user
|
||||
patch '/:user_uid/edit', to: 'users#update', as: :update_user
|
||||
|
||||
match '/terms', to: 'users#terms', via: [:get, :post]
|
||||
|
||||
# Handles login of greenlight provider accounts.
|
||||
post '/login', to: 'sessions#create', as: :create_session
|
||||
|
||||
# Log the user out of the session.
|
||||
get '/logout', to: 'sessions#destroy'
|
||||
|
||||
get '/:user_uid/edit', to: 'users#edit', as: :edit_user
|
||||
patch '/:user_uid/edit', to: 'users#update', as: :update_user
|
||||
end
|
||||
|
||||
# Handles launches from a trusted launcher.
|
||||
|
Reference in New Issue
Block a user