mirror of
https://github.com/moparisthebest/discourse-migratepassword
synced 2024-11-13 12:35:00 -05:00
Add bcrypt for Vanilla support
This commit is contained in:
parent
6a4581a3ae
commit
c37df1321f
@ -12,6 +12,7 @@
|
||||
# for Phorum #{password} md5(pass)
|
||||
# for Wordpress #{password} phpass(8).crypt(pass)
|
||||
|
||||
gem 'bcrypt', '3.1.3'
|
||||
|
||||
require 'digest'
|
||||
|
||||
@ -103,7 +104,12 @@ after_initialize do
|
||||
def self.check_all(password, crypted_pass)
|
||||
AlternativePassword::check_vbulletin(password, crypted_pass) ||
|
||||
AlternativePassword::check_md5(password, crypted_pass) ||
|
||||
AlternativePassword::check_wordpress(password, crypted_pass)
|
||||
AlternativePassword::check_wordpress(password, crypted_pass) ||
|
||||
AlternativePassword::check_bcrypt(password, crypted_pass)
|
||||
end
|
||||
|
||||
def self.check_bcrypt(password, crypted_pass)
|
||||
BCrypt::Password.new(crypted_pass) == password
|
||||
end
|
||||
|
||||
def self.check_vbulletin(password, crypted_pass)
|
||||
|
Loading…
Reference in New Issue
Block a user