Class: Monban::Domain::Auth::Authorized
- Inherits:
-
Object
- Object
- Monban::Domain::Auth::Authorized
- Includes:
- Getto::InitializeWith
- Defined in:
- lib/monban/domain/auth.rb
Instance Method Summary collapse
Instance Method Details
#decode(token) ⇒ Object
246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/monban/domain/auth.rb', line 246 def decode(token) ::JWT.decode( token, , true, { algorithm: , } ).first rescue ::JWT::DecodeError => e error! e. end |
#encode(account) ⇒ Object
259 260 261 262 263 264 265 |
# File 'lib/monban/domain/auth.rb', line 259 def encode(account) ::JWT.encode( account, , ) end |
#error!(message) ⇒ Object
267 268 269 |
# File 'lib/monban/domain/auth.rb', line 267 def error!() raise DecodeError, end |