# The admin site and WhatsApp sign-in

> For server admins - connect MauText in Admin, prove your WhatsApp number, require a WhatsApp check when admins sign in, switch PayPal on or off, and look up any notification in the log.

The admin site (the address set as `NODD_ADMIN_HOST`) already asks for your password and an authenticator code. You can add a third step: a WhatsApp check. You set it all up in the app, not in the server's files.

## Set it up

1. **Connect MauText.** Open **Admin**, then **Integrations**, then **Connect** next to MauText. Paste your MauText API key (from your MauText dashboard) and press **Connect**. OpenNodd tries the key first and tells you if MauText refuses it. The key is kept encrypted and is never shown again: you only see the start and the last four characters, like `mt_live_••••1234`. **Edit** lets you replace the key or disconnect.
2. **Prove your number.** On the main site, open **Settings**, then **Sign-in**, then **Add number** under **WhatsApp number**. Type your number with its country code, tap **Open WhatsApp** (or scan the QR code) and send the short message that is already written. A few seconds later the page says **Verified**. To change or remove the number, press **Change** or **Remove**. First you confirm it is you, in one of two ways: **I still have my old number** (send one message from it on WhatsApp), or **I lost it** (type your password and, if two-step sign-in is on, your authenticator or a recovery code). That proof lasts 10 minutes and works once. Then, for a change, you prove the new number, and the old one stays until you do. Every change and removal is written to the activity log and emailed to you (only the last four digits are shown) with a line to contact support and change your password if it wasn't you. **Remove** does not work while **Require WhatsApp for admin sign-in** is on.
3. **Require it.** In **Admin**, then **Settings**, turn on **Require WhatsApp for admin sign-in**. It only turns on when MauText is connected and your own number is verified, so you cannot lock yourself out.

## Signing in

After the password and authenticator code, the admin site shows **Open WhatsApp**. Send the message from your own number; the page signs you in as soon as MauText confirms it. A message from a different number, or one that takes more than 10 minutes, does not work: sign in again.

An admin with no verified number is turned away with "Add your WhatsApp number on the main site first". The admin site stays closed if MauText cannot be reached. It never lets anyone in on a guess.

You cannot disconnect MauText, or remove your number, while the setting is on. Turn the setting off first.

## Payments: the PayPal switch

Developers can buy credits for their apps with PayPal when the server has PayPal keys. To stop selling through PayPal without touching the server, open **Admin**, then **Settings**, and under **Payments** switch off **PayPal (developer credits)**. One tap, and it works at once.

- **On** (the default): developers see the credit packs under **Buy credits** and pay on PayPal.
- **Off**: **Buy credits** says buying isn't open yet and asks the developer to write to support. Nothing new is sold through PayPal.
- Credits already bought and the list of past payments stay as they are. A payment someone started before you switched it off still completes, and its credits are added.
- The row also says whether PayPal keys are set on the server. Without keys nothing is sold, whatever the switch says.

Only admins can change it, and every change is written to the activity log.

## Notifications: what was sent, and whether it arrived

OpenNodd tells people things in several ways: by email, with a notification on their phone, on Telegram, or through one of their own agents. Every one of them is written to one log, so when someone says "I never got it" you can look.

Open **Admin**, then **Notifications**. The list is newest first. Each line shows who was told, how long ago, what it was about (an approval, a message, a booking and so on), which way it went, and whether it was **Sent**, **Failed** or **Not sent**. Press **Open** on a line to read the full words and, when it didn't go, why.

- **Find a line.** Filter by a person or an agent (type their name, for example `kai` or `atlas`), by the way it was sent, by status, and by day. **Clear filters** shows everything again, and **Show older** loads the lines before.
- **Failed** means the email service, the phone's notification service or Telegram refused it. The reason they gave is under **Why**.
- **Not sent** means OpenNodd held it back, and says why: for example email is not set up on the server, or a phone was notified about the same chat less than 30 seconds before.
- **Their agent** means the notice was handed to the person's own agent to tell them. When the agent reports back, the line says how it told them, or that it couldn't.
- A phone notification never carries the words of a message, so its line only says "Something needs you" or "New message".
- Links are left out of the log, because some of them sign a person in or approve something.

The words, and the reason something failed or was held back, are stored encrypted, like messages, when the server has a secret key. Lines are removed after 90 days, a person's lines go when they delete their account, and if the server clears old message text after a number of days, the words in the log are cleared too. Only admins can read the log. The list never shows the words or the reason: they are fetched when you press **Open**, and each time an admin opens a notification it is written to the activity log (which admin, whose notification, what kind). Looking through the list is not logged. By API: `GET /v1/admin/notifications` for the list, `GET /v1/admin/notifications/<id>` for one line with its words and reason.

## If you are locked out

Set `NODD_ADMIN_WHATSAPP_VERIFY=0` in the server's environment and restart. The WhatsApp step is skipped (the password and authenticator code still apply). Fix the problem in **Admin**, then remove the line.

## Moving from the old server settings

Earlier versions were set up with `NODD_ADMIN_WHATSAPP_VERIFY=1`, `MAUTEXT_KEY` and `NODD_ADMIN_PHONES` in the server's environment. The first start of this version imports them once, if MauText is not connected in the app yet: the key is stored encrypted, each number is marked "imported" and counts as verified, and the setting is turned on. The server log then says the lines can be removed. After that the app is the only place that matters, and the import never runs again, even if you disconnect later. Only `NODD_ADMIN_WHATSAPP_VERIFY=0` stays useful.

Connecting, replacing and disconnecting MauText, and verifying or removing a number, are all in the activity log.
