Add support for multiple sessions

This commit is contained in:
Omar Roth
2018-08-15 12:40:42 -05:00
parent 45ce301bd2
commit 8adb4650a0
4 changed files with 25 additions and 17 deletions

View File

@@ -269,7 +269,7 @@ def generate_captcha(key)
answer = "#{hour}:#{minute.to_s.rjust(2, '0')}"
token = OpenSSL::HMAC.digest(:sha256, key, answer)
token = Base64.encode(token)
token = Base64.urlsafe_encode(token)
return {challenge: challenge, token: token}
end