Mercurial > prosody-modules
comparison mod_http_oauth2/mod_http_oauth2.lua @ 5463:dacde53467f3
mod_http_oauth2: Proper OAuth error for invalid redirect URI in implicit flow too
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 17 May 2023 16:40:07 +0200 |
parents | f6d8830a83fe |
children | 66e13e79928b |
comparison
equal
deleted
inserted
replaced
5462:f6d8830a83fe | 5463:dacde53467f3 |
---|---|
367 end | 367 end |
368 local granted_scopes, granted_role = filter_scopes(request_username, params.scope); | 368 local granted_scopes, granted_role = filter_scopes(request_username, params.scope); |
369 local token_info = new_access_token(granted_jid, granted_role, granted_scopes, client, nil); | 369 local token_info = new_access_token(granted_jid, granted_role, granted_scopes, client, nil); |
370 | 370 |
371 local redirect = url.parse(get_redirect_uri(client, params.redirect_uri)); | 371 local redirect = url.parse(get_redirect_uri(client, params.redirect_uri)); |
372 if not redirect then return 400; end | 372 if not redirect then return oauth_error("invalid_redirect_uri"); end |
373 token_info.state = params.state; | 373 token_info.state = params.state; |
374 redirect.fragment = http.formencode(token_info); | 374 redirect.fragment = http.formencode(token_info); |
375 | 375 |
376 return { | 376 return { |
377 status_code = 303; | 377 status_code = 303; |