Add support for standard webpush (#33528)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
ee4edbb94f
commit
4a2813158d
12 changed files with 167 additions and 46 deletions
|
@ -3,7 +3,7 @@
|
|||
class WebPushKeyValidator < ActiveModel::Validator
|
||||
def validate(subscription)
|
||||
begin
|
||||
Webpush::Legacy::Encryption.encrypt('validation_test', subscription.key_p256dh, subscription.key_auth)
|
||||
Webpush::Encryption.encrypt('validation_test', subscription.key_p256dh, subscription.key_auth)
|
||||
rescue ArgumentError, OpenSSL::PKey::EC::Point::Error
|
||||
subscription.errors.add(:base, I18n.t('crypto.errors.invalid_key'))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue