forked from 00dani/lemoncurry
Handle IndieAuth redirect URIs that already have query parameters
This commit is contained in:
parent
b658bf5c79
commit
6b1cd896ea
1 changed files with 5 additions and 2 deletions
|
@ -69,7 +69,7 @@ class IndieView(TemplateView):
|
||||||
|
|
||||||
client = mf2py.Parser(url=params['client_id'], html_parser='html5lib')
|
client = mf2py.Parser(url=params['client_id'], html_parser='html5lib')
|
||||||
rels = (client.to_dict()['rel-urls']
|
rels = (client.to_dict()['rel-urls']
|
||||||
.get(params['redirect_uri'], {})
|
.get(redirect_uri, {})
|
||||||
.get('rels', ()))
|
.get('rels', ()))
|
||||||
verified = 'redirect_uri' in rels
|
verified = 'redirect_uri' in rels
|
||||||
|
|
||||||
|
@ -119,4 +119,7 @@ class IndieView(TemplateView):
|
||||||
def approve(request):
|
def approve(request):
|
||||||
post = request.POST
|
post = request.POST
|
||||||
params = tokens.gen_auth_code(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…
Reference in a new issue