Re-import user's pubkey on access
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Sometimes, the pubkey might not be imported in the local keychain
(anymore), but at this point in the code it had been successfully
imported at least once before. So we just (re-)import every time for it
to never fail.
This commit is contained in:
Râu Cao 2024-10-08 11:34:18 +02:00
parent 729e4fd566
commit 3ee76e26ab
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -174,7 +174,8 @@ class User < ApplicationRecord
def gnupg_key
return nil unless pgp_pubkey.present?
@gnupg_key ||= GPGME::Key.get(pgp_fpr)
GPGME::Key.import(pgp_pubkey)
GPGME::Key.get(pgp_fpr)
end
def pgp_pubkey_contains_user_address?