upd: login
Deskripsi: - login token - logout No Issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ButtonForm } from "@/components/buttonForm";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { router } from "expo-router";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import CryptoES from "crypto-es";
|
||||
import React, { useState } from "react";
|
||||
import { Image, Text, View } from "react-native";
|
||||
import { CodeField, Cursor, useBlurOnFulfill, useClearByFocusCell, } from 'react-native-confirmation-code-field';
|
||||
@@ -13,7 +14,17 @@ export default function Index() {
|
||||
setValue,
|
||||
});
|
||||
|
||||
|
||||
const { signIn } = useAuthSession();
|
||||
const login = (): void => {
|
||||
const random: string = 'contohLoginMobileDarmasaba';
|
||||
var mytexttoEncryption = "contohLoginMobileDarmasaba"
|
||||
const encrypted = CryptoES.AES.encrypt(mytexttoEncryption, "your password").toString();
|
||||
// var C = require("crypto-js");
|
||||
// var Decrypted = C.AES.decrypt(encrypted, "your password");
|
||||
// var result = Decrypted.toString(C.enc.Utf8);
|
||||
// console.log(encrypted,result);
|
||||
signIn(encrypted);
|
||||
}
|
||||
return (
|
||||
<View style={Styles.wrapLogin} >
|
||||
<View style={{ alignItems: "center", marginVertical: 50 }}>
|
||||
@@ -45,7 +56,11 @@ export default function Index() {
|
||||
</Text>
|
||||
)}
|
||||
/>
|
||||
<ButtonForm text="SUBMIT" onPress={() => { router.push("/home") }} />
|
||||
<ButtonForm
|
||||
text="SUBMIT"
|
||||
// onPress={() => { router.push("/home") }}
|
||||
onPress={login}
|
||||
/>
|
||||
<Text style={[Styles.textInformation, Styles.mt05, Styles.cDefault, { textAlign: 'center' }]}>
|
||||
Tidak Menerima kode verifikasi? Kirim Ulang
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user