Commit 17bd5da2 authored by Lihinikaduwa D.N.R.  's avatar Lihinikaduwa D.N.R.

Merge branch 'it18257632' into 'master'

It18257632

See merge request !161
parents fbbe91b9 e920b62a
......@@ -179,4 +179,4 @@ def reading():
if __name__ == "__main__":
app.run(host='192.168.8.101')
app.run(host='192.168.1.100')
......@@ -12,7 +12,7 @@ def create_con():
database="helply",
host="127.0.0.1",
user="root",
password="rp19970520"
password="12345678"
)
return db
......
import {useNavigation} from '@react-navigation/native';
import AsyncStorage from '@react-native-async-storage/async-storage';
export function Authorize() {
const navigation = useNavigation();
AsyncStorage.getItem('userToken')
.then(value => {
console.log(value);
if (value) {
return value;
} else {
alert('Please Login.......');
navigation.navigate('Login');
}
})
.catch(error => {
console.log(error);
});
}
......@@ -97,8 +97,8 @@ const Login = () => {
return updateError('Please register our system', setError);
}
if (response.data.status == 200) {
const sessionToken = res.data.token;
AsyncStorage.setItem('token', token);
const userToken = res.data.token;
AsyncStorage.setItem('userToken', userToken);
return navigation.navigate('Start');
}
})
......
......@@ -18,15 +18,18 @@ import {DummyReadResult} from '../../../assets/read/data/ReadData';
import AudioRecord from 'react-native-audio-record';
import Client from '../../client/Client';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {Authorize} from '../../auth/AuthenticateUser';
export default function ReadActivityBird() {
const [pitch, setPitch] = useState('');
const userToken = Authorize();
const [error, setError] = useState('');
const [readingData, setReadingData] = useState({activity: ''});
const [started, setStarted] = useState('');
const [results, setResults] = useState([]);
const [partialResults, setPartialResults] = useState([]);
const readToken = localStorage.getItem('readingSession');
const readToken = AsyncStorage.getItem('readingSession');
useEffect(() => {
if (Authorize) {
}
}, []);
useEffect(() => {
Voice.onSpeechStart = onSpeechStartHandler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment