From 82ca88caebd1aefd4e49d2ba1486a9f0ff06213f Mon Sep 17 00:00:00 2001 From: saint Date: Sat, 7 Sep 2024 17:11:18 +1000 Subject: [PATCH] v0.16 So close, but it doesn't work still... --- plugin.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin.rb b/plugin.rb index f2cad9a..675e4d6 100644 --- a/plugin.rb +++ b/plugin.rb @@ -4,7 +4,7 @@ # name: discourse-legacy_links # about: A plugin to handle legacy Gossamer Forums URLs -# version: 0.18 +# version: 0.19 # authors: saint@federated.computer # url: https://gitea.federated.computer/saint/discourse-legacy_links.git @@ -22,11 +22,11 @@ after_initialize do # Define the custom controller class CustomPostController < ::ApplicationController -# skip_before_action :verify_authenticity_token -# skip_before_action :ensure_logged_in -# skip_before_action :redirect_to_login_if_required -# skip_before_action :check_xhr -# skip_before_action :ensure_staff + skip_before_action :verify_authenticity_token + skip_before_action :ensure_logged_in + skip_before_action :redirect_to_login_if_required + skip_before_action :check_xhr + skip_before_action :ensure_staff def test Rails.logger.warn "[WARN WARN WARN WARN WARN WARN WARN WARN WARN WARN AMDG JMJ PAX WARN WARN WARN WARN]" @@ -142,7 +142,7 @@ after_initialize do # get '/forum/*path', to: 'discourse_legacy_links/custom_post#index', constraints: lambda { |req| !Permalink.exists?(url: req.path) } get '/forum/*path', to: 'discourse_legacy_links/custom_post#index', constraints: lambda { |request| Rails.logger.warn("[DEBUG] StarForum Route matched: #{request.path}") } get '/forum', to: 'discourse_legacy_links/custom_post#index', constraints: lambda { |request| Rails.logger.warn("[DEBUG] NoStarForum Route matched: #{request.path}") } - get '/testroute2', to: 'discourse_legacy_links/custom_post#test', constraints: lambda { |request| Rails.logger.warn("[DEBUG] TestRoute Route matched: #{request.path}") } + get '/forum2', to: 'discourse_legacy_links/custom_post#test', constraints: lambda { |request| Rails.logger.warn("[DEBUG] TestRoute Route matched: #{request.path}") } # get '/testroute2' => 'discourse_legacy_links/custom_post#test' # get '/forum/*path' => 'discourse_legacy_links/custom_post#index' # get '/forum' => 'discourse_legacy_links/custom_post#index'