Skip to content

Commit

Permalink
Update App.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
AthanaD authored Jan 2, 2024
1 parent 152d607 commit 6853bb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,19 @@ const handlePasswordSubmit = () => {
console.log("ENV Password:", process.env.REACT_APP_ACCESS_PASSWORD);
console.log("Entered Password:", password);

if (password === process.env.REACT_APP_ACCESS_PASSWORD) {
// 检查环境变量是否存在
const envPassword = process.env.REACT_APP_ACCESS_PASSWORD;

// 如果环境变量不存在或者密码匹配,则认证成功
if (!envPassword || password === envPassword) {
setIsAuthenticated(true);
setShowPasswordModal(false);
} else {
alert('Incorrect password');
}
};


return (
<div className='overflow-hidden w-full h-full relative'>
{!isAuthenticated && (
Expand Down

0 comments on commit 6853bb8

Please sign in to comment.