From 1082a61c14c03ed744c935c7a587fce3a0b43237 Mon Sep 17 00:00:00 2001 From: saint Date: Thu, 29 Aug 2024 16:10:01 +1000 Subject: [PATCH] v0.17 Yet another fixup to work with Bitnami Discourse 3.2.5 - password_expired? not supported --- plugin.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/plugin.rb b/plugin.rb index a821878..5cdc62a 100644 --- a/plugin.rb +++ b/plugin.rb @@ -4,7 +4,7 @@ # name: discourse-md5_authentication # about: A plugin to authenticate users with MD5 passwords from legacy systems -# version: 0.16 +# version: 0.17 # authors: saint@federated.computer # url: https://gitea.federated.computer/saint/discourse-md5_authentication.git @@ -102,13 +102,13 @@ after_initialize do # Invalidate any invite link for the user Invite.invalidate_for_email(user.email) - # Check if the user's password has expired - if user.password_expired?(password) - render json: { error: "expired", reason: "expired" } - return - end +# 3.3.0 # Check if the user's password has expired +# if user.password_expired?(password) +# render json: { error: "expired", reason: "expired" } +# return +# end else - # If no user is found with the provided credentials + # No user is found with the provided credentials invalid_credentials return end @@ -213,6 +213,8 @@ after_initialize do end # Extend the SessionController class to include the LegacyMd5Authentication module + +# 3.3.0 class ::SessionController < ApplicationController class ::SessionController prepend LegacyMd5Authentication end