Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

swetix 2fa docs

Blue Mouseb4b49b928a03
diff --git a/docs/accountsettings/2-factor-authentication.md b/docs/accountsettings/2-factor-authentication.md
deleted file mode 100644
index d35153324..000000000
--- a/docs/accountsettings/2-factor-authentication.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-title: Set up 2-factor authentication (2FA) for your account
-slug: /settings/2-factor-authentication
----
-
-import useBaseUrl from '@docusaurus/useBaseUrl';
-
diff --git a/docs/accountsettings/two-factor-authentication.md b/docs/accountsettings/two-factor-authentication.md
new file mode 100644
index 000000000..d58249ca1
--- /dev/null
+++ b/docs/accountsettings/two-factor-authentication.md
@@ -0,0 +1,42 @@
+---
+title: Set up 2-factor authentication (2FA) for your account
+slug: /settings/2-factor-authentication
+---
+
+import useBaseUrl from '@docusaurus/useBaseUrl';
+
+Two-factor authentication (2FA) adds a second layer of defense to your ­­account, so even if someone gets hold of your password they still can’t sign in.
+
+Once 2FA is enabled, when you try to log into your account you’ll need:
+1. Your account password, and
+2. A one-time verification code generated on a trusted device.
+
+To enable 2FA, you'll need to scan our 2FA QR code with your authenticator app and enter the generated code to Swetrix account settings. Any TOTP generator app works, but we recommend Ente Auth (Android, iOS, Web), Aegis Authenticator (Android) or Bitwarden.
+
+We also provide you with a recovery code that you can enter in case you lose access to your 2FA code generator.
+
+## How to enable 2FA
+
+To enable 2FA, you need to log in to your account and go to the [account settings page](https://swetrix.com/user-settings).
+
+On the "Account" tab, you will see the "Two-factor authentication (2FA)" section. Click on the "Enable 2FA" button.
+
+A QR code will appear. Scan it with your authenticator app to link it to your Swetrix account. Alternatively, you can enter the provided secret key into the app instead.
+
+Enter the one-time code generated by your authenticator app and click "Enable" button.
+
+<img alt="Enable 2FA screen" src={useBaseUrl('img/accountsettings/enable-2fa.png')} />
+
+A recovery code will be generated and shown to you. Keep it private and store it somewhere safe. You will need it to access your account or disable 2FA in case you can't provide a one-time code generated by your authenticator app.
+
+<img alt="Enter one-time code screen" src={useBaseUrl('img/accountsettings/2fa-recovery-code.png')} />
+
+## How to disable 2FA
+
+To disable 2FA, on the [account settings page](https://swetrix.com/user-settings), scroll down to the "Two-factor authentication (2FA)" section and click on the "Disable 2FA" button.
+
+In the input field shown afterwards, enter a one-time code generated by your authenticator app or a recovery code and click on the "Disable" button.
+
+:::warning
+Once you disable the 2FA, verification codes from the authenticator application and saved recovery codes will become invalid.
+:::
\ No newline at end of file
diff --git a/sidebars.js b/sidebars.js
index 312ff694f..d21b2404d 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -32,7 +32,7 @@ module.exports = {
'sitesettings/reset-sites-data',
],
'Account settings': [
- // 'accountsettings/2-factor-authentication',
+ 'accountsettings/two-factor-authentication',
'accountsettings/change-email',
'accountsettings/change-password',
'accountsettings/delete-account',
diff --git a/static/img/accountsettings/2fa-recovery-code.png b/static/img/accountsettings/2fa-recovery-code.png
new file mode 100644
index 000000000..bedede50c
Binary files /dev/null and b/static/img/accountsettings/2fa-recovery-code.png differ
diff --git a/static/img/accountsettings/enable-2fa.png b/static/img/accountsettings/enable-2fa.png
new file mode 100644
index 000000000..c48781028
Binary files /dev/null and b/static/img/accountsettings/enable-2fa.png differ