Skip to content

Commit

Permalink
fix registration_allowed_url check with js:
Browse files Browse the repository at this point in the history
  • Loading branch information
sorah committed Dec 6, 2017
1 parent 9261deb commit e7558b1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/clarion/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,14 @@ def render_authn_json(authn)
unless params[:name] && params[:callback] && params[:public_key]
halt 400, 'missing params'
end
if params[:callback].start_with?('js:') && !(conf.registration_allowed_url === params[:callback])
halt 400, 'invalid callback'
if params[:callback].start_with?('js:')
unless conf.registration_allowed_url === params[:callback][3..-1]
halt 400, 'invalid callback'
end
else
unless conf.registration_allowed_url === params[:callback]
halt 400, 'invalid callback'
end
end

public_key = begin
Expand Down

0 comments on commit e7558b1

Please sign in to comment.