Updated login page

This commit is contained in:
Patrick Alvin Alcala 2025-12-18 17:16:10 +08:00
parent 2287a21672
commit cfa8f7bd82

View file

@ -1,11 +1,10 @@
import { useNavigate } from '@solidjs/router'
import { SHA1, SHA3 } from 'crypto-js'
import { IoChevronBack } from 'solid-icons/io'
import { createEffect, createSignal } from 'solid-js'
import { Show } from 'solid-js/web'
import { Box, Button, Column, Combobox, Display, Input, Link, Logo, Modal, Padding, Page, Radio, Row } from '../../components'
import { _employeeId, _employeeName } from '../../stores/employee'
import { checkConnection, getApi } from '../../utils/functions'
import { checkConnection, getApi, securePassword } from '../../utils/functions'
import './Login.sass'
export default () => {
@ -30,7 +29,7 @@ export default () => {
const employeeid = await getApi('get-employeeid', name())
const dbpassword = await getApi('get-password', employeeid)
const hashPassword = await securePassword()
const hashPassword = await securePassword(password())
if (dbpassword === '0') {
setErrorMessage('Not yet registered. Please proceed to Registration.')
@ -48,13 +47,13 @@ export default () => {
}
}
const securePassword = async () => {
const firstHashing = SHA1(password())
const secondHashing = SHA3(firstHashing)
const thirdHashing = SHA1(secondHashing)
// const securePassword = async () => {
// const firstHashing = SHA1(password())
// const secondHashing = SHA384(firstHashing.toString())
// const thirdHashing = SHA1(secondHashing.toString())
return thirdHashing.toString()
}
// return thirdHashing.toString()
// }
const gotoMain = () => {
navigate('/main')