finished customer pages
This commit is contained in:
@ -42,7 +42,6 @@
|
||||
<div class="buttons">
|
||||
<input type="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="login-button" value="Login"
|
||||
@click="handleLogin">
|
||||
<!-- <input type="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="signup-button" value="Signup" @click="testFunctionSignup"> -->
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
@ -90,21 +89,7 @@ const handleLogin = async () => {
|
||||
}
|
||||
|
||||
try {
|
||||
/*let res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/login`, requestBody);
|
||||
|
||||
const sessionToken = useCookie('token', {maxAge: 604800, sameSite: true});
|
||||
sessionToken.value = res.data.token;
|
||||
Axios.defaults.headers.common['Authorization'] = `${username}`;
|
||||
const userToken = useCookie('user', {maxAge: 604800, sameSite: true});
|
||||
userToken.value = username;
|
||||
// something to do with the res?
|
||||
console.log(sessionToken)
|
||||
console.log(res.data.message)
|
||||
|
||||
// sucessfully logged in
|
||||
router.push('/home')*/
|
||||
let resBody = await signIn(credentials, { callbackUrl: '/home' })
|
||||
// let resBody = await signIn(credentials, { callbackUrl: await delayRedirect(callbackUrl, delayInSeconds * 1000) });
|
||||
try {
|
||||
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/login`);
|
||||
setItem('logged-in-bool', true);
|
||||
@ -139,68 +124,6 @@ const handleLogin = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// const testFunctionSignup = async () => {
|
||||
// isError.value = false;
|
||||
// errorMsg.value = '';
|
||||
|
||||
// const username = 'adm_tueit'
|
||||
// const password = 'SvF=?bfEx7_hV,cMEu4m'
|
||||
// const password_repeat = 'SvF=?bfEx7_hV,cMEu4m'
|
||||
// const fullName = 'administrator'
|
||||
// const email = 'support@tueit.de'
|
||||
// const phonenumber = ''
|
||||
// const address = ''
|
||||
// const city = ''
|
||||
// const postcode = ''
|
||||
// const adminBool = true
|
||||
// const technician1Bool = false
|
||||
// const technician2Bool = false
|
||||
// const technicianMonitoringBool = false
|
||||
// const merchantBool = false
|
||||
// const internBool = true
|
||||
|
||||
// const requestBody = {
|
||||
// username: username,
|
||||
// password: password,
|
||||
// password_repeat: password_repeat,
|
||||
// fullName: fullName,
|
||||
// email: email,
|
||||
// phonenumber: phonenumber,
|
||||
// address: address,
|
||||
// city: city,
|
||||
// postcode: postcode,
|
||||
// adminBool: adminBool,
|
||||
// technician1Bool: technician1Bool,
|
||||
// technician2Bool: technician2Bool,
|
||||
// technicianMonitoringBool: technicianMonitoringBool,
|
||||
// merchantBool: merchantBool,
|
||||
// internBool: internBool,
|
||||
// }
|
||||
|
||||
// try {
|
||||
|
||||
// let res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/signup`, requestBody);
|
||||
|
||||
// // something to do with the res?
|
||||
// // console.log(res)
|
||||
|
||||
// } catch (err) {
|
||||
// // handle the error
|
||||
// console.log(err.response.statusText)
|
||||
// isError.value = true;
|
||||
// errorMsg.value = err.response.statusText;
|
||||
// }
|
||||
// }
|
||||
|
||||
const getSession = async () => {
|
||||
// const loggedInUserDarkModeBool = getItem('logged-in-user-darkMode');
|
||||
// if (loggedInUserDarkModeBool == 1) {
|
||||
// darkMode.value = true;
|
||||
// } else {
|
||||
// darkMode.value = false;
|
||||
// }
|
||||
}
|
||||
|
||||
function getItem(item) {
|
||||
if (process.client) {
|
||||
return localStorage.getItem(item)
|
||||
@ -210,7 +133,6 @@ function getItem(item) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getSession();
|
||||
document.addEventListener('keyup', handleKeyUp);
|
||||
document.getElementById('username-input').value = '';
|
||||
document.getElementById('password-input').value = '';
|
||||
@ -230,12 +152,6 @@ const handleKeyUp = (event) => {
|
||||
<script>
|
||||
export default {
|
||||
name: "LoginForm",
|
||||
data() {
|
||||
return {
|
||||
// isError: false,
|
||||
// errorMsg: '',
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user