Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
fixed login issues
Browse files Browse the repository at this point in the history
  • Loading branch information
raisfeld-ori committed Mar 22, 2024
1 parent d24b8bd commit ab7105a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/data/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ fn test_authentication(){
use crate::data::json::init_user_data;
init_user_data();
init_dir().expect("failed to create the main directory");
let name = "a";
let password = "a";
let name = "test";
let password = "test";
if user_exists(name, password) {}
else {assert!(create_user(name, password).is_ok());}
assert!(save_user(name, password).is_ok());
Expand Down
6 changes: 0 additions & 6 deletions src/pages/login/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useState } from 'react';
import { invoke } from '@tauri-apps/api';
import { useNavigate } from 'react-router-dom';
import noenemies from '../main_page/assets/nature.jpg';
import arrowright from '../main_page/assets/arrowright.png';

function login(){
const [name, setname] = useState("");
Expand All @@ -15,8 +14,6 @@ function login(){
let response = await invoke("authenticate_user", {name, password}).catch(e => {console.log(e)});
console.log(response);
if (response){
await invoke('system_make', {key: 'name',value: await invoke('create_value', {val_type: 'string', val: name})});
await invoke('system_make', {key: 'password',value: await invoke('create_value', {val_type: 'string', val: password})});
navigate("/loading", {state: {name, password}});
}
else{
Expand Down Expand Up @@ -69,9 +66,6 @@ function login(){
</span>
<span className="button-text">Login</span>
</button>
<div className='dev'>
<img className='skippinclass' src={arrowright} alt="" onClick={() => navigate("/main_page")}/>
</div>
<br />
<p id='error'>{error}</p>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/main_page/internal_apps/apps/file_system.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { invoke } from '@tauri-apps/api';
import { useState, useEffect } from 'react';

async function create_file(){
// console.log(await invoke('system_get', {key: 'name'}));
console.log(await invoke('system_get', {key: 'name'}));
}

function file_system() : [JSX.Element, React.Dispatch<React.SetStateAction<string>>, JSX.Element]{
Expand Down

0 comments on commit ab7105a

Please sign in to comment.