v0.17 Yet another fixup to work with Bitnami Discourse 3.2.5 - password_expired? not supported
This commit is contained in:
parent
7226bf0b9a
commit
1082a61c14
16
plugin.rb
16
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
|
||||
|
Loading…
Reference in New Issue
Block a user