fix check credentials in loop
This commit is contained in:
parent
69d1873da4
commit
fcc4b34424
|
@ -258,6 +258,7 @@ class AllowCodeOidc4vpView(GenericMixin):
|
|||
'Content-Type': 'application/json',
|
||||
'Authorization': f'Bearer {WALLET_INX_EBSI_PLUGIN_TOKEN}'
|
||||
}
|
||||
for v in vcredential:
|
||||
data = json.dumps({
|
||||
"type": "VerificationRequest",
|
||||
"jwtCredential": vcredential[0]
|
||||
|
@ -267,15 +268,22 @@ class AllowCodeOidc4vpView(GenericMixin):
|
|||
headers=headers,
|
||||
data=data
|
||||
)
|
||||
|
||||
if result.status_code != 200:
|
||||
return
|
||||
|
||||
vps = json.loads(result.text)
|
||||
try:
|
||||
roles = vps['credential']['credentialSubject'].get('role')
|
||||
except Exception:
|
||||
roles = None
|
||||
|
||||
if roles:
|
||||
break
|
||||
|
||||
if not vps.get('verified'):
|
||||
return
|
||||
|
||||
return vps['credential']['credentialSubject'].get('role')
|
||||
return roles
|
||||
|
||||
def get_response_uri(selfi, roles):
|
||||
code = Code2Roles(roles=roles)
|
||||
|
|
Reference in New Issue