decode method to decode a token