From dde32df97915a52486e995389bf7e0eeaf5d7efb Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Mon, 30 Jun 2025 15:38:17 +1000 Subject: [PATCH] add: feedbin credential verification --- app/index.tsx | 5 +++++ app/login.tsx | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 app/index.tsx diff --git a/app/index.tsx b/app/index.tsx new file mode 100644 index 0000000..850883c --- /dev/null +++ b/app/index.tsx @@ -0,0 +1,5 @@ +import { Redirect } from 'expo-router'; + +export default function Index() { + return ; +} \ No newline at end of file diff --git a/app/login.tsx b/app/login.tsx index efc0ce7..47fdcd7 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -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 - +