Added support for Google Sign-In, optional in every way.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3187 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2016-04-03 19:31:03 +00:00
parent 7b112c5376
commit cbf54eaa17
9 changed files with 199 additions and 18 deletions

View File

@@ -178,6 +178,11 @@ function handler(request, response, packageOwner, packageName, uri) {
found = true;
var data = File.readFile("core/" + kStaticFiles[i].path);
if (kStaticFiles[i].uri == "") {
if (gGlobalSettings && gGlobalSettings['google-signin-client_id']) {
data = data.replace("<!--HEAD-->", `
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="${gGlobalSettings['google-signin-client_id']}">`);
}
data = data.replace("$(VIEW_SOURCE)", "/~" + packageOwner + "/" + packageName + "/view");
data = data.replace("$(EDIT_SOURCE)", "/~" + packageOwner + "/" + packageName + "/edit");
} else if (kStaticFiles[i].uri == "/edit") {