Test mode
#Live and test mode
By default, your Userfront account is in test mode.
Test mode allows you to experiment and develop locally without affecting your live data.
You can enable live mode by adding a live domain.
- Activate your account
- Add your domain as a live domain
- Your page must use
https://
#Why is my form in test mode?
If your page is not secured with https
, or if the domain you are using is not on your list of live domains, your forms will be in test mode.
Example test domains include:
- http:// example.com
- localhost:3000
- 192.168.1.10
To work with live data, follow the steps to activate live mode.
Reason | Explanation |
---|---|
Test mode: http | Your page is served over http , which is insecure. This is OK for local development but not for production. |
Test mode: domain | The domain or subdomain has not been added to your account's live domains. Add the domain to activate live mode. |
#Working in test mode
Your account is first created with 4 test users, each with an initial password set to testmodepassword
.
You can log in with these users to test your application or you can sign up new users. Your initial users behave the same as any other user who signs up.
When in test mode, Userfront does not send welcome or confirmation emails.
Anywhere an email would have been sent to a user, that information is displayed directly in the browser instead.
Your initial test users:
Username | Password | |
---|---|---|
admin | admin@example.com | testmodepassword |
member | member@example.com | testmodepassword |
viewer | viewer@example.com | testmodepassword |
unconfirmed | unconfirmed@example.com | testmodepassword |
Example: you could use admin
for the username and testmodepassword
for the password, and your login form will log you in as the Admin User above.
#Allowed test mode passwords
Several basic passwords are allowed in test mode to make testing easier.
These passwords will not work in live mode.
Reserved passwords that will work in test mode |
---|
test |
dev |
password |
#Working in live mode
Once you have added your live domain, all requests from your live domain will be in live mode.
Userfront uses the origin
header to determine live mode.
This header is automatically set by the browser with each request and cannot be overridden.
#Include subdomains
If the "Include subdomains" toggle is selected for a live domain, Userfront treats all subdomains as live mode too.
This table gives example scenarios for various subdomain settings.
Live domain | Include subdomains | Live mode | Test mode |
---|---|---|---|
example.com | true | sub.example.com , sub.sub.example.com | |
example.com | false | Only example.com | sub.example.com , sub.sub.example.com |
sub.example.com | true | sub1.sub.example.com , sub2.sub.example.com | example.com , another.example.com |
sub.example.com | false | Only sub.example.com | example.com , another.example.com , sub.sub.example.com |
#API requests in live mode
To make non-browser client-to-server API requests in live mode, include your live domain as the origin
of the request.
For server-to-server API requests made with an API key, you do not need to include the origin
header.