Use the URL safe base64 variant for mail tokens
This commit is contained in:
parent
690cfb5eaf
commit
68845eb725
2 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@ class DiaryComment < ApplicationRecord
|
|||
sha256 << Rails.application.key_generator.generate_key("openstreetmap/diary_comment")
|
||||
sha256 << id.to_s
|
||||
sha256 << subscriber.to_s
|
||||
sha256.base64digest[0, 8]
|
||||
Base64.urlsafe_encode64(sha256.digest)[0, 8]
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -63,6 +63,6 @@ class Message < ApplicationRecord
|
|||
sha256 = Digest::SHA256.new
|
||||
sha256 << Rails.application.key_generator.generate_key("openstreetmap/message")
|
||||
sha256 << id.to_s
|
||||
sha256.base64digest[0, 8]
|
||||
Base64.urlsafe_encode64(sha256.digest)[0, 8]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue