diff --git a/app/controllers/authorizations_controller.rb b/app/controllers/authorizations_controller.rb index 5d71a0afc..555c3b6c7 100644 --- a/app/controllers/authorizations_controller.rb +++ b/app/controllers/authorizations_controller.rb @@ -54,9 +54,15 @@ class AuthorizationsController < ApplicationController return end - packaged_manifest = JSON.parse(RestClient.get("#{app_url}manifest.json").body) - public_key = OpenSSL::PKey::RSA.new(packaged_manifest['public_key']) - manifest = JWT.decode(packaged_manifest['jwt'], public_key) + begin + packaged_manifest = JSON.parse(RestClient.get("#{app_url}manifest.json").body) + public_key = OpenSSL::PKey::RSA.new(packaged_manifest['public_key']) + manifest = JWT.decode(packaged_manifest['jwt'], public_key) + rescue => e + puts "there was a problem with getting a token for the following diaspora id" + puts "#{app_url}, #{public_key.to_s} #{manifest.to_s}" + raise e + end message = verify(signed_string, Base64.decode64(params[:signature]), public_key, manifest) if not (message =='ok')