add: feedbin credential verification
This commit is contained in:
parent
fe7d3bdd9a
commit
dde32df979
5
app/index.tsx
Normal file
5
app/index.tsx
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { Redirect } from 'expo-router';
|
||||
|
||||
export default function Index() {
|
||||
return <Redirect href="/login" />;
|
||||
}
|
|
@ -1,12 +1,25 @@
|
|||
import { TextInput, View, StyleSheet, Button } from 'react-native'
|
||||
import { useState } from 'react'
|
||||
import axios from 'axios'
|
||||
|
||||
export default function LoginView() {
|
||||
const [email, setEmail] = useState('')
|
||||
const [username, setUsername] = useState('')
|
||||
const [password, setPassword] = useState('')
|
||||
|
||||
function login() {
|
||||
console.log(email, password)
|
||||
async function login() {
|
||||
console.log(username, password)
|
||||
try {
|
||||
const res = await axios.get("https://api.feedbin.com/v2/authentication.json", {
|
||||
auth: {
|
||||
username,
|
||||
password
|
||||
}
|
||||
})
|
||||
console.log(res.status)
|
||||
} catch(e) {
|
||||
console.log("error on verifing your credentials")
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
@ -22,7 +35,7 @@ export default function LoginView() {
|
|||
}
|
||||
})
|
||||
return <View style={styles.container}>
|
||||
<TextInput placeholder="Feedbin Email" style={styles.textfield} autoCapitalize="none" autoCorrect={false} textContentType="none" keyboardType="email-address" onChangeText={setEmail} />
|
||||
<TextInput placeholder="Feedbin Email" style={styles.textfield} autoCapitalize="none" autoCorrect={false} textContentType="none" keyboardType="email-address" onChangeText={setUsername} />
|
||||
<TextInput placeholder="Password" style={styles.textfield} secureTextEntry={true} onChangeText={setPassword} />
|
||||
<Button title="Enter" onPress={login} />
|
||||
</View>
|
||||
|
|
Loading…
Reference in New Issue
Block a user