refactor: Clean up console logging and improve code formatting in UserAuth and signInApi
This commit is contained in:
parent
4eac6c628f
commit
4d738d576a
|
@ -41,7 +41,6 @@ const UserAuth: React.FC = () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await signInApi(email, password, organization, fingerprint);
|
const res = await signInApi(email, password, organization, fingerprint);
|
||||||
console.log('res: ', res);
|
|
||||||
if (res.message.message === "login successfull") {
|
if (res.message.message === "login successfull") {
|
||||||
setError("");
|
setError("");
|
||||||
setOrganization(organization);
|
setOrganization(organization);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
|
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
|
||||||
|
|
||||||
export const signInApi = async (Email: string,Password: Object,organization: Object,fingerprint:any) => {
|
export const signInApi = async (Email: string, Password: Object, organization: Object, fingerprint: any) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${url_Backend_dwinzo}/api/V1/Auth/login`, {
|
const response = await fetch(`${url_Backend_dwinzo}/api/V1/Auth/login`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {"Content-Type": "application/json",},
|
headers: { "Content-Type": "application/json", },
|
||||||
body: JSON.stringify({ Email, Password, organization,fingerprint}),
|
body: JSON.stringify({ Email, Password, organization, fingerprint }),
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Dwinzo_dev",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
Loading…
Reference in New Issue