The sign in method completion block now sends a Token instance instead
of a dictionary. This class does not has an optional constructor since
we require it to always have valid data. Instead, this constructor will
throw an error if the dictionary it received was invalid.
This is awesome because it means that this class handles what error is
thrown. For now we throw APIError, but in the future there may be many
different kind of errors. Or maybe APIError will have a property which
defines what kind of error happened.
The sign in method completion block now sends a Token instance instead of a dictionary. This class does not has an optional constructor since we require it to always have valid data. Instead, this constructor will throw an error if the dictionary it received was invalid.
This is awesome because it means that this class handles what error is thrown. For now we throw APIError, but in the future there may be many different kind of errors. Or maybe APIError will have a property which defines what kind of error happened.