diff --git a/tokenauth.inc b/tokenauth.inc
index e99c81b..714fed7 100644
--- a/tokenauth.inc
+++ b/tokenauth.inc
@@ -50,7 +50,7 @@ function tokenauth_reset_user($uid = NULL, $token = NULL, $update = TRUE) {
   }
   $entry = array(
     'uid' => $uid,
-    'token' => isset($token) ? $token : user_password(variable_get('tokenauth_length', 10)),
+    'token' => isset($token) ? $token : user_password(variable_get('tokenauth_length', TOKENAUTH_DEFAULT_TOKEN_LENGTH)),
   );
   if (!$update) {
     // drupal_write_record mysteriously failing from tokenauth_enable().
diff --git a/tokenauth.module b/tokenauth.module
index 1719cea..3c1b6af 100644
--- a/tokenauth.module
+++ b/tokenauth.module
@@ -7,6 +7,8 @@
 
 include_once('tokenauth.inc');
 
+define('TOKENAUTH_DEFAULT_TOKEN_LENGTH', 20);
+
 /**
  * Implements hook_permission().
  */
diff --git a/tokenauth.pages.inc b/tokenauth.pages.inc
index 3bca9a9..7feb4ee 100644
--- a/tokenauth.pages.inc
+++ b/tokenauth.pages.inc
@@ -21,7 +21,7 @@ function tokenauth_admin_settings() {
     '#size' => 4,
     '#maxlength' => 4,
     '#required' => TRUE,
-    '#default_value' => variable_get('tokenauth_length', 10),
+    '#default_value' => variable_get('tokenauth_length', TOKENAUTH_DEFAULT_TOKEN_LENGTH),
     '#description' => t('Does not affect existing tokens.'),
   );
   $form['tokenauth_general']['tokenauth_pages'] = array(
