mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 00:17:17 +08:00
store honeypot challenge in redis for extra security
This commit is contained in:
@ -415,7 +415,13 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
def challenge_value
|
||||
'3019774c067cc2b'
|
||||
challenge = $redis.get('SECRET_CHALLENGE')
|
||||
unless challenge && challenge.length == 16*2
|
||||
challenge = SecureRandom.hex(16)
|
||||
$redis.set('SECRET_CHALLENGE',challenge)
|
||||
end
|
||||
|
||||
challenge
|
||||
end
|
||||
|
||||
def suspicious?(params)
|
||||
|
Reference in New Issue
Block a user