Skip to content

Commit

Permalink
Fix token login :)
Browse files Browse the repository at this point in the history
  • Loading branch information
StarNumber12046 committed Sep 19, 2024
1 parent cf7609e commit 3b2c1f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions app/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,15 @@ export default function LoginScreen() {
onChange={handleChange}
></TextInput>
</View>
<Text style={styles.topText}>
Not working? Try <Link href="/tokenLogin">Token Login</Link>
</Text>
<Text>{error}</Text>
<View style={{ flex: 1 }}>
<Text style={[{ color: "white" }]}>
Not working? Try{" "}
<Link href="/tokenLogin" style={{ fontWeight: "bold" }}>
Token Login
</Link>
</Text>
<Text style={{ color: "red" }}>{error}</Text>
</View>
<Pressable
style={styles.buttonContainer}
onPress={trySendOTP}
Expand Down Expand Up @@ -189,7 +194,6 @@ const styles = StyleSheet.create({
alignItems: "center",
},
container: {
flex: 1,
flexDirection: "row",
gap: 8,
alignItems: "flex-start",
Expand Down
4 changes: 2 additions & 2 deletions app/tokenLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function TokenLogin() {
const [accessToken, setAccessToken] = useState<string>("");
const [refreshToken, setRefreshToken] = useState<string>("");
async function login() {
AsyncStorage.setItem("authToken", accessToken);
AsyncStorage.setItem("refreshToken", refreshToken);
await AsyncStorage.setItem("authToken", accessToken);
await AsyncStorage.setItem("refreshToken", refreshToken);
router.push("/onboarding");
}
const [error, setError] = useState<string>("");
Expand Down

0 comments on commit 3b2c1f2

Please sign in to comment.