!7
html {
if (eq(uri, "/callback")) {
ret print("We're back from Google! " + hpre(pnlToString(params)));
}
O json = decodeJSON(trimLoadMandatoryTextFile(javaxSecretDir("google-calendar/credentials.json")));
Map installed = cast get((Map) json, "installed");
S client_id = assertNempty("client_id", (S) get(installed, "client_id"));
S scope = "https://www.googleapis.com/auth/calendar";
ret hrefresh(2.0, googleOAuthRedirectURL(rawLink("/callback"), client_id, scope)) + "Redirecting to Google...";
}