~ren/magentasso-py

5b129c4827c9e69b0214ac16b8417ebed4204f33 — Lauren Jenkinson 7 months ago bb9d1cc
response: Add some helper methods
1 files changed, 15 insertions(+), 0 deletions(-)

M magentasso/response.py
M magentasso/response.py => magentasso/response.py +15 -0
@@ 71,5 71,20 @@ class MagentaResponse:

        return output

    def profile_name(self):
        if 'profile' in self.scope_data:
            name_first = self.scope_data['profile'].get('name_first', None)
            name_last = self.scope_data['profile'].get('name_last', None)

            return (name_first, name_last)

        return None

    def external_id(self):
        return self.user_data.get('external_id', None)

    def email_address(self):
        return self.user_data.get('email', None)

    def __repr__(self):
        return "MagentaResponse(client_id=%r nonce=%r)" % (self.client_id, self.nonce,)