require 'jwt' class JWTManager def self.encode(payload) full_payload = { data: payload } JWT.encode(full_payload, nil, 'none') end def self.decode(jwt) JWT.decode(jwt, nil, false).first["data"] end end