Skip to content

Commit

Permalink
Merge pull request #864 from supertokens/fix/ci-fix
Browse files Browse the repository at this point in the history
Fix code sample errors
  • Loading branch information
bcbogdan authored Oct 25, 2024
2 parents e8cc966 + efb9d05 commit 7eb6d5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions v2/microservice_auth/client-credentials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ You can use the [PyJWT](https://github.com/jpadilla/pyjwt) library to verify the

```python
from typing import Optional, List
import requests
import jwt
from jwt import PyJWKClient

Expand Down Expand Up @@ -379,11 +378,11 @@ def validate_token(token: str) -> bool:
return False

scopes: List[str] = decoded.get('scp', [])
if not isinstance(scopes, list) or required_scope not in scopes:
if required_scope not in scopes:
return False

return True
except Exception as e:
except Exception:
return False

```
Expand Down
6 changes: 2 additions & 4 deletions v2/unified-login/customizations/verify-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ You can use the [PyJWT](https://github.com/jpadilla/pyjwt) library to verify the

```python
from typing import Optional, List
import requests
import jwt
from jwt import PyJWKClient

Expand All @@ -177,7 +176,6 @@ def validate_token(token: str) -> bool:
token,
signing_key.key,
algorithms=['RS256'],
audience=audience,
options={"require": ["stt", "client_id", "scp"]}
)

Expand All @@ -191,11 +189,11 @@ def validate_token(token: str) -> bool:


scopes: List[str] = decoded.get('scp', [])
if not isinstance(scopes, list) or required_scope not in scopes:
if required_scope not in scopes:
return False

return True
except Exception as e:
except Exception:
return False

```
Expand Down

0 comments on commit 7eb6d5e

Please sign in to comment.