Skip to content
Snippets Groups Projects
Commit d205c835 authored by Jens Christian Aanestad's avatar Jens Christian Aanestad
Browse files

Merge branch 'refactor/Login' into 'main'

feat/Created the login link and sign up link components

See merge request !27
parents 9ef74cd3 42b97f10
No related branches found
No related tags found
1 merge request!27feat/Created the login link and sign up link components
Pipeline #275826 failed
<script setup lang="ts">
import { RouterView } from 'vue-router'
// import ErrorBoundaryCatcher from '@/components/Exceptions/ErrorBoundaryCatcher.vue';
import ErrorBoundaryCatcher from '@/components/Exceptions/ErrorBoundaryCatcher.vue';
</script>
<template>
......
......@@ -16,6 +16,12 @@ const props = defineProps({
}
})
/**
* This method is run whenever a change has occurred in the checkbox. It retrieves
* the current value of the checkbox (true/false) and emits a data object containing
* the challenge's description and the checked value.
* @param event The event object containing information about the input's checked value.
*/
const onChallengeChanged = (event: any) => {
const value = event.target.checked
const data = [props.text, value]
......
<script setup lang="ts">
import ProgressBar from '@/components/Configuration/ProgressBar.vue'
import ProgressBar from '@/components/Configuration/ConfigurationProgressBar.vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useRoute } from 'vue-router'
......@@ -17,7 +17,7 @@ let currentRoute = useRoute()
let currentPath = currentRoute.fullPath
// Sets the current path to a new path and updates progressbar
const onNewRouteEvent = (path) => {
const onNewRouteEvent = (path: string) => {
currentPath = path
percentage.value = (1/length) * configurationSteps[path]
}
......
......@@ -7,6 +7,7 @@ import { AuthenticationService, OpenAPI, LoginRequest } from '@/api';
import { useRouter, useRoute } from 'vue-router';
import handleUnknownError from '@/components/Exceptions/unkownErrorHandler';
import { useErrorStore } from '@/stores/ErrorStore';
import SignUpLink from '@/components/SignUp/SignUpLink.vue'
const emailRef = ref('')
const passwordRef = ref('')
......@@ -95,6 +96,7 @@ const handleSubmit = async () => {
<p class="text-danger">{{ errorMsg }}</p>
<button1 id="confirmButton" type="submit" @click="handleSubmit" button-text="Login"></button1>
<SignUpLink/>
</form>
</div>
</template>
......
<script setup lang="ts">
</script>
<template>
<p>Already have an account? <RouterLink to="/login">Login</RouterLink></p>
</template>
<style scoped>
</style>
\ No newline at end of file
......@@ -6,6 +6,7 @@ import { useRouter } from 'vue-router'
import { AuthenticationService } from '@/api'
import handleUnknownError from '@/components/Exceptions/unkownErrorHandler'
import { useUserInfoStore } from '@/stores/UserStore'
import LoginLink from '@/components/Login/LoginLink.vue'
const router = useRouter();
const userStore = useUserInfoStore();
......@@ -113,6 +114,7 @@ const handleSubmit = async () => {
<p class="text-danger">{{ errorMsg }}</p>
<p v-if="!samePasswords" class="text-danger">The passwords are not identical</p>
<button1 id="confirmButton" @click="handleSubmit" button-text="Sign up"></button1>
<LoginLink/>
</form>
</div>
......
<script setup lang="ts">
</script>
<template>
<p>Don't have an account? <RouterLink to="/sign-up">Sign up</RouterLink></p>
</template>
<style scoped>
</style>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment