Browse Source

Handle IndieAuth redirect URIs that already have query parameters

pull/1/head
Danielle McLean 4 years ago
parent
commit
6b1cd896ea
Signed by: 00dani GPG Key ID: 5A5D2D1AFF12EEC5
  1. 7
      lemonauth/views/indie.py

7
lemonauth/views/indie.py

@ -69,7 +69,7 @@ class IndieView(TemplateView):
client = mf2py.Parser(url=params['client_id'], html_parser='html5lib')
rels = (client.to_dict()['rel-urls']
.get(params['redirect_uri'], {})
.get(redirect_uri, {})
.get('rels', ()))
verified = 'redirect_uri' in rels
@ -119,4 +119,7 @@ class IndieView(TemplateView):
def approve(request):
post = request.POST
params = tokens.gen_auth_code(post)
return redirect(post['redirect_uri'] + '?' + urlencode(params))
uri = post['redirect_uri']
sep = '&' if '?' in uri else '?'
return redirect(uri + sep + urlencode(params))

Loading…
Cancel
Save