diff --git a/src/pretix/presale/views/customer.py b/src/pretix/presale/views/customer.py index e3075ca5e..8ec30e025 100644 --- a/src/pretix/presale/views/customer.py +++ b/src/pretix/presale/views/customer.py @@ -720,7 +720,7 @@ class SSOLoginReturnView(RedirectBackMixin, View): raise Http404("Unknown SSO method.") identifier = hashlib.sha256( - profile['uid'].encode() + b'@' + str(self.provider.pk).encode() + str(profile['uid']).encode() + b'@' + str(self.provider.pk).encode() ).hexdigest().upper()[:settings.ENTROPY['customer_identifier']] if "1" not in identifier and "0" not in identifier: # This is a hack to make sure the hash space does not overlap with the random identifiers generated by @@ -753,7 +753,7 @@ class SSOLoginReturnView(RedirectBackMixin, View): customer = Customer( organizer=self.request.organizer, identifier=identifier, - external_identifier=profile['uid'], + external_identifier=str(profile['uid']), provider=self.provider, email=profile['email'], phone=profile.get('phone') or None, @@ -767,7 +767,7 @@ class SSOLoginReturnView(RedirectBackMixin, View): customer_created.send(customer.organizer, customer=customer) customer.log_action('pretix.customer.created', user=self.request.user, data=dict( identifier=identifier, - external_identifier=profile['uid'], + external_identifier=str(profile['uid']), provider=self.provider.pk, email=profile['email'], phone=profile.get('phone') or None, @@ -806,7 +806,7 @@ class SSOLoginReturnView(RedirectBackMixin, View): '_source': 'provider' }) - if customer.external_identifier != profile['uid']: + if customer.external_identifier != str(profile['uid']): return self._fail( _('Login was not successful. Error message: "{error}".').format( error='identifier not unique',