Skip to content

Commit 6ae52f1

Browse files
committed
Give better error message when invalid data is passed to cauth in d param
This imports the latest version of upstream.
1 parent 9971ef3 commit 6ae52f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pgcommitfest/auth.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ def auth_receive(request):
211211
# Finally, check of we have a data package that tells us where to
212212
# redirect the user.
213213
if 'd' in data:
214-
(nonces, datas, tags) = data['d'][0].split('$')
214+
splitdata = data['d'][0].split('$')
215+
if len(splitdata) != 3:
216+
return HttpResponse("Invalid login pass-through data received, likely because of an old link. Please try again.")
217+
(nonces, datas, tags) = splitdata
215218
decryptor = AES.new(
216219
SHA256.new(settings.SECRET_KEY.encode('ascii')).digest()[:32],
217220
AES.MODE_SIV,

0 commit comments

Comments
 (0)