Skip to content

Commit

Permalink
Add docs on template files
Browse files Browse the repository at this point in the history
  • Loading branch information
NuSkooler committed Jun 16, 2019
1 parent abc6a36 commit da961c3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
Binary file added art/themes/luciano_blocktronics/2FAOTP.ans
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/modding/user-2fa-otp-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,23 @@ The following MCI codes are available:
* MCI 3: (ie: `TM3`): Submit/cancel toggle.
* MCI 10...99: Custom entries with the following format members available:
* `{infoText}`: **Info Text** for current selection.

### Web and Email Templates
A template system is also available to customize registration emails and the landing page.

#### Emails
Multipart MIME emails are send built using template files pointed to by `users.twoFactorAuth.otp.registerEmailText` and `users.toFactorAuth.otp.registerEmailHtml` supporting the following variables:
* `%BOARDNAME%`: BBS name.
* `%USERNAME%`: Username receiving email.
* `%TOKEN%`: Temporary registration token generally used in URL.
* `%REGISTER_URL%`: Full registration URL.

#### Landing Page
The landing page template is pointed to by `users.twoFactorAuth.otp.registerPageTemplate` and supports the following variables:
* `%BOARDNAME%`: BBS name.
* `%USERNAME%`: Username receiving email.
* `%TOKEN%`: Temporary registration token generally used in URL.
* `%OTP_TYPE%`: OTP type such as `googleAuth`.
* `%POST_URL%`: URL to POST form to.
* `%QR_IMG_DATA%`: QR code in URL image data format. Not always available depending on OTP type and will be set to blank in these cases.
* `%SECRET%`: Secret for manual entry.
11 changes: 11 additions & 0 deletions misc/otp_register_email.template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<b>%USERNAME%</b>:<br>
<br>
<p>
You have requested to enable 2-Factor Authentication via One-Time-Password for your account on <b>%BOARDNAME%</b>.<br>
</p>
<p>
If this was not you, please ignore this email and <u>consider changing your password</u>. Otherwise, <a href="%REGISTER_URL%">please follow this link</a> or copy and paste the link below:<br><br>
%REGISTER_URL%<br>
</p>


7 changes: 7 additions & 0 deletions misc/otp_register_email.template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%USERNAME%:

You have requested to enable 2-Factor Authentication via One-Time-Password for your account on %BOARDNAME%.

If this was not you, please ignore this email and consider changing your password. Otherwise, please follow the link below:

%REGISTER_URL%
8 changes: 4 additions & 4 deletions www/otp_register.template.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<head>
<meta charset="utf-8">
<title>Enable 2FA/OTP — ENiGMA½ BBS</title>
<meta name="description" content="Enable 2-Factor Authentication via One-Time-Password">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<p>
Your OTP secret:<br>
Expand Down

0 comments on commit da961c3

Please sign in to comment.