mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
store honeypot challenge in redis for extra security
This commit is contained in:
parent
011d3cf779
commit
90dddb4395
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue