diff --git a/docs/docs/en/user-guide/ui/mesop/basics.md b/docs/docs/en/user-guide/ui/mesop/basics.md index da27f2db..e128121f 100644 --- a/docs/docs/en/user-guide/ui/mesop/basics.md +++ b/docs/docs/en/user-guide/ui/mesop/basics.md @@ -253,7 +253,7 @@ Finally, we instantiate **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI. 1. User Setup: - - The **`allowed_users`** parameter accepts a dictionary that maps usernames (e.g., emails) to their [**bcrypt-hashed**](https://en.wikipedia.org/wiki/Bcrypt){target="_blank"} passwords. + - The **`allowed_users`** parameter accepts a dictionary that maps usernames to their [**bcrypt-hashed**](https://en.wikipedia.org/wiki/Bcrypt){target="_blank"} passwords. - Only bcrypt hashing is supported; other hashing algorithms (like MD5 or SHA-256) will not work with [**`BasicAuth`**](../../../../api/fastagency/ui/mesop/auth/basic_auth/BasicAuth.md) class. 2. Hashing Passwords with Bcrypt: @@ -274,15 +274,15 @@ Finally, we instantiate **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI. ```py allowed_users = { - "harish@airt.ai": "$2y$10$4aH/.C.WritjZAYskA0Dq.htlFDJTa49UuxSVUlp9JCa2K3PgUkaG" # nosemgrep + "harish": "$2y$10$4aH/.C.WritjZAYskA0Dq.htlFDJTa49UuxSVUlp9JCa2K3PgUkaG" # nosemgrep } ``` - In this example, the hash is generated from `someStrongPassword` for the user `harish@airt.ai`. + In this example, the hash is generated from `someStrongPassword` for the user `harish`. **Authenticating in the Mesop Web App** - To log in, users should enter their **original passwords** (e.g., `someStrongPassword` for `harish@airt.ai`) on the Mesop application’s login screen. The `BasicAuth` class then verifies the password by comparing its bcrypt hash with the stored hash in `allowed_users`. If the hashes match, the user is successfully authenticated. + To log in, users should enter their **original passwords** (e.g., `someStrongPassword` for `harish`) on the Mesop application’s login screen. The `BasicAuth` class then verifies the password by comparing its bcrypt hash with the stored hash in `allowed_users`. If the hashes match, the user is successfully authenticated. === "Firebase Authentication" ```python hl_lines="29-36 39-44 46" diff --git a/docs/docs_src/user_guide/ui/mesop/main_mesop_basic_auth.py b/docs/docs_src/user_guide/ui/mesop/main_mesop_basic_auth.py index 9e6afe4f..eeb90de5 100644 --- a/docs/docs_src/user_guide/ui/mesop/main_mesop_basic_auth.py +++ b/docs/docs_src/user_guide/ui/mesop/main_mesop_basic_auth.py @@ -91,7 +91,7 @@ def simple_workflow( # bcrypt-hashed passwords. One way to generate bcrypt-hashed passwords # is by using online tools such as https://bcrypt.online allowed_users={ - "harish@airt.ai": "$2y$10$4aH/.C.WritjZAYskA0Dq.htlFDJTa49UuxSVUlp9JCa2K3PgUkaG", # nosemgrep + "harish": "$2y$10$4aH/.C.WritjZAYskA0Dq.htlFDJTa49UuxSVUlp9JCa2K3PgUkaG", # nosemgrep "davor@airt.ai": "$2y$10$Yz9GuF/bWmRFmnXFkauOwePT/U.VSUHdpMOX7GPB8GiklJE4HJZmG" # nosemgrep } ) diff --git a/javascript/basic_auth_component.js b/javascript/basic_auth_component.js index 2e08d462..ab6f89a0 100644 --- a/javascript/basic_auth_component.js +++ b/javascript/basic_auth_component.js @@ -224,6 +224,9 @@ class BasicAuthComponent extends LitElement { if (form) { form.reset(); } + + // Refresh the browser + window.location.reload(); } catch (error) { console.error("Sign out error:", error); }