package FPauth-strategies

  1. Overview
  2. Docs

Source file TOTP_pages.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#1 "src/strategies/TOTP_pages.eml.ml"
let error_tmpl ~app_name err =
let ___eml_buffer = Buffer.create 4096 in
(Buffer.add_string ___eml_buffer "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>");
(Printf.bprintf ___eml_buffer "%s" (Dream.html_escape (
#6 "src/strategies/TOTP_pages.eml.ml"
                 app_name^" TOTP error"
)));
(Buffer.add_string ___eml_buffer "</title>\n  </head>\n  <body>\n    <div id=\"error\">TOTP setup error: ");
(Printf.bprintf ___eml_buffer "%s" (Dream.html_escape (
#9 "src/strategies/TOTP_pages.eml.ml"
                                            err
)));
(Buffer.add_string ___eml_buffer "</div>\n  </body>\n</html>\n\n");
(Buffer.contents ___eml_buffer)
#13 "src/strategies/TOTP_pages.eml.ml"
let secret_tmpl ~app_name request form_url secret =
let ___eml_buffer = Buffer.create 4096 in
(Buffer.add_string ___eml_buffer "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>");
(Printf.bprintf ___eml_buffer "%s" (Dream.html_escape (
#18 "src/strategies/TOTP_pages.eml.ml"
                 app_name^" TOTP secret"
)));
(Buffer.add_string ___eml_buffer "</title>\n  </head>\n  <body>\n    <div id=\"secret\">\n      <p id=\"secret line\">TOTP secret: ");
(Printf.bprintf ___eml_buffer "%s" (Dream.html_escape (
#22 "src/strategies/TOTP_pages.eml.ml"
                                             secret
)));
(Buffer.add_string ___eml_buffer "</p>\n      <p id=\"secret comment\">Add this secret in your code-generating app (like Google Authenticator).</p>\n    </div>\n    <form method=\"POST\" action=");
(Printf.bprintf ___eml_buffer "%s" (Dream.html_escape (
#25 "src/strategies/TOTP_pages.eml.ml"
                                     form_url
)));
(Buffer.add_string ___eml_buffer " >\n      ");
(Printf.bprintf ___eml_buffer "%s" (
#26 "src/strategies/TOTP_pages.eml.ml"
             Dream.csrf_tag request 
));
(Buffer.add_string ___eml_buffer "\n      <input id=\"totp_code\" name=\"totp_code\">\n      <button id=\"submit_code\" type=\"submit\">Submit</button>\n    </form>\n  </body>\n</html>\n\n");
(Buffer.contents ___eml_buffer)
#33 "src/strategies/TOTP_pages.eml.ml"
let finish_tmpl ~app_name () =
let ___eml_buffer = Buffer.create 4096 in
(Buffer.add_string ___eml_buffer "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>");
(Printf.bprintf ___eml_buffer "%s" (Dream.html_escape (
#38 "src/strategies/TOTP_pages.eml.ml"
                 app_name^" TOTP finished"
)));
(Buffer.add_string ___eml_buffer "</title>\n  </head>\n  <body>\n    <div id=\"message\">TOTP setup finished. You can now send Time-based One-time passwords for authentication.</div>\n  </body>\n</html>");
(Buffer.contents ___eml_buffer)