def handle(self, *args, **options):
email = options['email']
if ' ' in email or email.count('@') != 1:
raise CommandError(f'Invalid email {email!r}')
users = find_users(
settings.OIDC_RP_CLIENT_ID,
settings.OIDC_RP_CLIENT_SECRET,
urlparse(settings.OIDC_OP_USER_ENDPOINT).netloc,
email,
requests,
)
for user in users:
if user.get('blocked'):
self.stdout.write(self.style.ERROR('BLOCKED!'))
else:
self.stdout.write(self.style.SUCCESS('NOT blocked!'))
break
else:
self.stdout.write(self.style.WARNING(
f'{email} could not be found in Auth0'
))
评论列表
文章目录