Configuration

Learn how to configure FreeAuth REST API server.

The .env file is located at the root of a FreeAuth project and can override or extend the application's behavior.

.env
# This will override the value of current AppID
FREEAUTH_APP_ID=freeauth_app_id
KeyTypeDefaultDescription
debugbooleanfalseWhether debug mode is enabled.
testingbooleanfalseWhether testing mode is enabled. You should enable this in your own tests.
freeauth_app_idstringCurrent FreeAuth App ID
EdgeDB settings
edgedb_instancestringThe name of a local instance. Only useful in development.
edgedb_databasestringedgedbThe name of EdgeDB database.
edgedb_dsnstringEdgeDB connection string. See the DSN Specification.
Authentication settings
jwt_algorithmstringHS256The algorithm to use for signing the JWT claims.
jwt_token_ttlinteger1440The JWT token expiration time in minutes.
jwt_secret_keystringsecret_keyThe key to use for signing the JWT claim set.
jwt_cookie_keystringaccess_tokenThe key name of the JWT cookie.
jwt_cookie_securebooleantrueBrowsers will only send cookies with requests over HTTPS if the cookie is marked secure.
verify_code_ttlinteger10The verification codes' expiration time in minutes.
verify_code_cool_downinteger60The verification codes' cool-down period in seconds.
Mail settings
mail_from_namestringFreeAuthThe name of sender.
mail_fromstringThe sender address.
mail_usernamestringThe username of the email service.
mail_passwordstringThe password of the email service.
mail_portinteger25The port number of the mail server.
mail_serverstringlocalhostSMTP Mail server.
mail_starttlsbooleanfalseFor STARTTLS connections
mail_ssl_tlsbooleanfalseFor connecting over TLS/SSL
SMS settings
sms_providerstringThe name of the SMS provider, which can be tencent-cloud or aliyun.
sms_secret_idstringThe SecretId which is used to identify a provider.
sms_secret_keystringThe SecretKey which is used to verify a provider. You must keep your SecretKey secret confidential.
sms_sign_namestringThe content of SMS signature.
sms_regionstringFor tencent-cloud provider only, the region where TencentCloud SMS service is located, see available regions.
sms_app_idstringFor tencent-cloud provider only, SMS SDKAppID generated after and application is added in the TencentCloud console.
sms_auth_code_tpl_idstringThe template code/ID for auth code.