diff --git a/.env.example b/.env.example index 4b3ea5c..acbdfca 100644 --- a/.env.example +++ b/.env.example @@ -40,10 +40,6 @@ LOOPS_API_KEY=your_loops_api_key_here # Sentry DSN for error tracking SENTRY_DSN=your_sentry_dsn_here -# 🃏 -WILDCARD_AIRTABLE_KEY=your_airtable_key_here -WILDCARD_HOST=your_wildcard_host_here - # key for updating loops via airtable LOOPS_AIRTABLE_PAT=your_airtable_key_here diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index f1afcc0..f079d15 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -182,44 +182,6 @@ class StaticPagesController < ApplicationController render partial: "filterable_dashboard_content" end - def 🃏 - redirect_to root_path unless current_user && current_user.slack_uid.present? - - record = HTTP.auth("Bearer #{ENV.fetch("WILDCARD_AIRTABLE_KEY")}").patch("https://api.airtable.com/v0/appt3yVn2nbiUaijm/tblRCAMjfQ4MIsMPp", - json: { - records: [ - { - fields: { - slack_id: current_user.slack_uid - } - } - ], - performUpsert: { - fieldsToMergeOn: [ "slack_id" ] - } - } - ) - record_data = JSON.parse(record.body) - - record_id = record_data.dig("records", 0, "id") - - redirect_to root_path unless record_id&.present? - - # if record is created, set a new auth_key: - auth_key = SecureRandom.hex(16) - HTTP.auth("Bearer #{ENV.fetch("WILDCARD_AIRTABLE_KEY")}").patch("https://api.airtable.com/v0/appt3yVn2nbiUaijm/tblRCAMjfQ4MIsMPp", - json: { - records: [ - { id: record_id, fields: { auth_key: auth_key } } - ] - } - ) - - wildcard_host = ENV.fetch("WILDCARD_HOST") - - redirect_to "#{wildcard_host}?auth_key=#{auth_key}", allow_other_host: wildcard_host - end - private def ensure_current_user diff --git a/config/routes.rb b/config/routes.rb index f93b8f0..5afde3a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -52,7 +52,6 @@ Rails.application.routes.draw do get :filterable_dashboard_content get :filterable_dashboard get :mini_leaderboard - get "🃏", to: "static_pages#🃏", as: :wildcard get :streak # get :timeline # Removed: Old route for timeline end