Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit 84f4157

Browse files
committed
Don’t depend on old private PyJWT API
base64url_decode wasn’t meant to be public API and has since been moved.
1 parent 744d90b commit 84f4157

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/test_utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from jwt import base64url_decode
2+
import base64
33

44
from django.contrib.auth import get_user_model
55
from django.test import TestCase
@@ -8,6 +8,15 @@
88
User = get_user_model()
99

1010

11+
def base64url_decode(input):
12+
rem = len(input) % 4
13+
14+
if rem > 0:
15+
input += b'=' * (4 - rem)
16+
17+
return base64.urlsafe_b64decode(input)
18+
19+
1120
class UtilsTests(TestCase):
1221
def setUp(self):
1322
self.username = 'jpueblo'

0 commit comments

Comments
 (0)