From f0dbd25944e054f727a015467bce91bb04574323 Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Tue, 10 Jan 2012 13:40:08 -0700
Subject: [PATCH] simplify previous commit - .well-known/browserid really
 doesn't need a template and must be sent with application/json content-type -
 issue #865

---
 lib/browserid/views.js                     | 6 +-----
 resources/views/declaration_of_support.ejs | 3 ---
 2 files changed, 1 insertion(+), 8 deletions(-)
 delete mode 100644 resources/views/declaration_of_support.ejs

diff --git a/lib/browserid/views.js b/lib/browserid/views.js
index 92801b915..362ec942e 100644
--- a/lib/browserid/views.js
+++ b/lib/browserid/views.js
@@ -116,7 +116,6 @@ exports.setup = function(app) {
 
   try {
     const publicKey = secrets.loadPublicKey();
-    const pkAsString = JSON.stringify(publicKey.toSimpleObject());
   } catch(e){
     logger.error("can't read public key, exiting: " + e);
     process.nextTick(function() { process.exit(1); });
@@ -135,9 +134,6 @@ exports.setup = function(app) {
   // browserid.org as a secondary (and anyone else they decide to for
   // whatever reason).
   app.get("/.well-known/browserid", function(req, res) {
-    res.render('declaration_of_support.ejs', {
-      key: pkAsString,
-      layout: false
-    });
+    res.json({ 'public-key': publicKey.toSimpleObject() });
   });
 };
diff --git a/resources/views/declaration_of_support.ejs b/resources/views/declaration_of_support.ejs
deleted file mode 100644
index a7381f0c7..000000000
--- a/resources/views/declaration_of_support.ejs
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "public-key": <%- key %>
-}
-- 
GitLab