add ability to configure terms and conditions

This commit is contained in:
Josh
2018-06-21 16:17:18 -04:00
parent 2dc033ee20
commit c16197670b
12 changed files with 67 additions and 10 deletions

View File

@ -5,5 +5,4 @@ test:
adapter: test
production:
adapter: redis
url: redis://localhost:6379/1
adapter: async

View 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

View File

@ -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.