Authentication for your app
Most apps need to know who is using them. This guide helps you decide who should be able to sign in, what each kind of person may do, and how to ask the Kree8 agent for sign-in that is safe by default – then how to test it before real people arrive.
Every Kree8 project comes with its own database and server code, so the agent can build sign-in, accounts and roles into your app. The guidance below explains what to ask for and how to test it. Signing in to your own Kree8 account at /platform/ is a separate thing.
Two different kinds of sign-in
It helps to keep two things apart:
- Your Kree8 account. This is how you sign in at /platform/ with your email address and password to see your balance, buy credits and open your projects. Sign-up refuses throw-away (disposable) email addresses. If your studio session expires, sign in to Kree8 again and reopen the project from “Your projects”.
- Accounts inside your app. These belong to your customers, staff or members. They are stored in your project’s database, not in Kree8, and you decide the rules: who can register, what they can see and how they recover a lost password.
Your app’s users never need a Kree8 account, and your Kree8 password is never used by your app.
Plan who signs in and what they can do
Before asking for sign-in, spend a few minutes writing down the people involved. The agent builds better permissions when it has a clear picture.
- List the roles. For example: visitor (not signed in), customer, staff member, owner. Keep it to as few as genuinely differ.
- Say what each role may see and change. “Customers see only their own orders; staff see all orders but cannot change prices; the owner can do everything.”
- Decide how people join. Open registration, invitation only, or accounts created by an administrator.
- Decide how people get back in. Password reset by email, a one-time code sent by email, or an administrator resetting it by hand.
- Decide what happens to old accounts. Can people delete their account? Can an administrator suspend one?
What to ask the agent for
Describe the people and rules in plain language. You do not need to name techniques; the agent should apply the checklist below anyway, but it does no harm to mention it.
“Add sign-in to my booking app. Customers register with email and password and see only their own bookings. Staff accounts are created by me and can see every booking for their branch. I’m the owner (me@example.com) and can manage staff. Store passwords as salted hashes, check permissions on the server, and limit failed sign-in attempts.”
“Show me which pages and actions each role can reach, and point out anything that is only hidden in the page but not checked on the server.”
Asking the agent to explain its own permission rules back to you is a quick way to spot gaps before anyone else does.
Security checklist
Whatever kind of app you are building, sign-in should meet each of these points. Ask the agent to confirm them one by one.
| Check | What it means in practice |
|---|---|
| Salted password hashes | Passwords are never stored as typed. Only a salted, one-way hash is kept, so a leaked database does not reveal anyone’s password. |
| Signed sessions | After sign-in, the app issues a signed session token. The server checks the signature on every request, so a token cannot be edited to impersonate someone else. |
| Server-side permission checks | Hiding a button is not security. Every action that reads or changes data checks the person’s role on the server. |
| Rate limiting | Repeated failed sign-in attempts are slowed down or temporarily blocked, which defeats password guessing. |
| Secrets stay on the server | API keys and signing secrets live in your project’s server settings, never in the page and never pasted into the chat. |
| Sign-out | There is a clear way to sign out, and signing out ends the session rather than just hiding the account menu. |
| Helpful but vague errors | A failed sign-in says “email or password incorrect” rather than revealing which accounts exist. |
Password reset and email codes
Password reset links and one-time sign-in codes both work by emailing the person. That means they depend on your app being able to send email from a domain that is verified for sending. Until that is in place, the agent cannot make these features work reliably.
- Connect your domain. See Domains and DNS.
- Verify it for sending. See Email and verified sender, and check the domain shows as verified before going further.
- Then ask for the feature. Reset links and codes should expire quickly and work only once.
“My domain is verified for sending. Add ‘Forgot password’ that emails a reset link from no-reply@mydomain.com. The link should expire after 30 minutes and work only once.”
Each reset or code email counts towards your daily sending limit and is metered per recipient, so rate-limit these requests as well.
Testing sign-in with test accounts
Test every role before you invite real people. A short, repeatable routine catches most mistakes.
- Create one test account per role. Ask the agent to set them up and tell you which is which. Use clearly fake names so they are easy to remove later.
- Sign in as each one. Check that each role sees exactly what you planned – no more, no less.
- Try to break it. As a customer, open a link that belongs to another customer’s record. You should be refused, not shown the data.
- Check the edges. Wrong password several times, signing out and pressing Back, an expired reset link.
- Remove test accounts before launch. Or ask the agent to disable them.
“Create test accounts for a customer, a staff member and an owner, and give me a checklist of what each one should and shouldn’t be able to do.”
If something behaves unexpectedly, describe the steps you took, what you expected and what actually happened, plus any error text. See Troubleshooting for more.