Merge branch 'main' into main
This commit is contained in:
commit
119832ee39
6 changed files with 567 additions and 525 deletions
|
@ -50,25 +50,11 @@ const Login: React.FC = () => {
|
|||
|
||||
// Function to handle login
|
||||
const handleLogin = async () => {
|
||||
const savedAccountEmail = localStorage.getItem('accountEmail');
|
||||
const savedAccountPassword = localStorage.getItem('accountPassword');
|
||||
const savedAccountName = localStorage.getItem('accountName');
|
||||
|
||||
// Check if savedAccountName or savedAccountEmail is not null before passing to checkCredentials
|
||||
var accountIdentifier = savedAccountName || savedAccountEmail;
|
||||
if (!accountIdentifier) {
|
||||
accountIdentifier = accountName
|
||||
}
|
||||
|
||||
if (accountIdentifier && password) {
|
||||
const success = await checkCredentials(accountIdentifier, password);
|
||||
if (accountName && password) {
|
||||
const success = await checkCredentials(accountName, password);
|
||||
if (success) {
|
||||
setIsLoggedIn(true); // Successful login
|
||||
setShowLoginPopup(false); // Close the login popup
|
||||
// Save credentials to localStorage (optional in case of changes)
|
||||
localStorage.setItem('accountName', savedAccountName || accountName);
|
||||
localStorage.setItem('accountEmail', savedAccountEmail || email);
|
||||
localStorage.setItem('accountPassword', savedAccountPassword || password);
|
||||
} else {
|
||||
alert('Incorrect credentials');
|
||||
}
|
||||
|
|
|
@ -37,11 +37,8 @@ const PrivacySettings: React.FC<PrivacySettingsProps> = ({ selectedOption, handl
|
|||
>
|
||||
None{openSourceMode ? ' (FOSS)' : ''}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<p>
|
||||
After changing the preferred settings, please reload the website so it can update itself properly.
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue