OpenAuth_server/src/views/authorize.ts

27 lines
781 B
TypeScript
Raw Normal View History

2018-11-06 19:48:50 +00:00
import { compile, TemplateDelegate } from "handlebars"
import { readFileSync } from "fs";
import { __ as i__ } from "i18n"
import config from "../config";
let template: TemplateDelegate<any>;
function loadStatic() {
let html = readFileSync("./views/out/authorize/authorize.html").toString();
template = compile(html)
}
export default function GetAuthPage(__: typeof i__, appname: string, scopes: { name: string, description: string, logo: string }[]): string {
if (config.dev) {
loadStatic()
}
return template({
title: __("Authorize %s", appname),
information: __("By clicking on ALLOW, you allow this app to access the requested recources."),
scopes: scopes,
// request: request
}, { helpers: { "i18n": __ } });
}
loadStatic()