From d5f0063de651cf13a99154383a0739eabdddf23f Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Wed, 8 Jul 2020 02:14:11 -0700 Subject: [PATCH] Run migration; add apple pay verification --- app/controllers/application_controller.rb | 6 ++++++ config/routes.rb | 2 ++ db/schema.rb | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c15681aa..31529b62 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,6 +8,7 @@ class ApplicationController < ActionController::Base before_action :store_location # Ensure every controller authorizes resource or skips authorization (skip_authorization_check) check_authorization unless: :devise_controller? + skip_authorization_check if: def store_location # store last url - this is needed for post-login redirect to whatever the user last visited. @@ -65,4 +66,9 @@ class ApplicationController < ActionController::Base def not_found raise ActionController::RoutingError.new('Not Found') end + + skip_authorization_check only: :apple_pay + def apple_pay + render plain: ENV['OSEM_APPLE_PAY_ID'] + end end diff --git a/config/routes.rb b/config/routes.rb index 478e7294..0d6084e6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -230,4 +230,6 @@ Osem::Application.routes.draw do else root to: 'conferences#index', via: [:get, :options] end + + get '/.well-known/apple-developer-merchantid-domain-association', to: 'application#apple_pay' end diff --git a/db/schema.rb b/db/schema.rb index c16b9f8f..3f862d87 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -12,6 +12,9 @@ ActiveRecord::Schema.define(version: 2020_03_31_214534) do + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + create_table "answers", force: :cascade do |t| t.string "title" t.datetime "created_at" @@ -638,7 +641,7 @@ ActiveRecord::Schema.define(version: 2020_03_31_214534) do t.text "object_changes" t.datetime "created_at" t.integer "conference_id" - t.integer "organization_id" + t.bigint "organization_id" t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" t.index ["organization_id"], name: "index_versions_on_organization_id" end