mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
store honeypot challenge in redis for extra security
This commit is contained in:
@ -415,7 +415,13 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def challenge_value
|
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
|
end
|
||||||
|
|
||||||
def suspicious?(params)
|
def suspicious?(params)
|
||||||
|
Reference in New Issue
Block a user