Module: Morpho::Cipher

Defined in:
lib/morpho/cipher.rb

Class Method Summary collapse

Class Method Details

.jwt_decode(token, algorithm = Morpho.config.jwt.algorithm) ⇒ Object



9
10
11
# File 'lib/morpho/cipher.rb', line 9

def jwt_decode(token, algorithm = Morpho.config.jwt.algorithm)
  ::JWT.decode(token, Morpho.config.jwt.secret, true, algorithm: algorithm)
end

.jwt_encode(payload, algorithm = Morpho.config.jwt.algorithm) ⇒ Object



5
6
7
# File 'lib/morpho/cipher.rb', line 5

def jwt_encode(payload, algorithm = Morpho.config.jwt.algorithm)
  ::JWT.encode(payload, Morpho.config.jwt.secret, algorithm)
end