Browse Source

[+] Updated Auth Page

- Made changes to the Auth Page to reset the input field for the access code when the "Later" button is clicked.
This ensures that only expected user is logged by entering access code or entering their OpenAI API Key, mitigating the risk of small bug issue
B0zal 1 year ago
parent
commit
b5e89d4440
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/components/auth.tsx

+ 5 - 1
app/components/auth.tsx

@@ -15,6 +15,7 @@ export function AuthPage() {
   const access = useAccessStore();
   const access = useAccessStore();
 
 
   const goHome = () => navigate(Path.Home);
   const goHome = () => navigate(Path.Home);
+  const resetAccessCode = () => access.updateCode(""); // Reset access code to empty string
 
 
   useEffect(() => {
   useEffect(() => {
     if (getClientConfig()?.isApp) {
     if (getClientConfig()?.isApp) {
@@ -48,7 +49,10 @@ export function AuthPage() {
           type="primary"
           type="primary"
           onClick={goHome}
           onClick={goHome}
         />
         />
-        <IconButton text={Locale.Auth.Later} onClick={goHome} />
+        <IconButton text={Locale.Auth.Later} onClick={() => {
+          resetAccessCode();
+          goHome();
+        }} />
       </div>
       </div>
     </div>
     </div>
   );
   );