-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '25-login-page' into 33-ama-create-file-structure
- Loading branch information
Showing
12 changed files
with
497 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_DEFAULT_IDP=https://css12.onto-deside.ilabt.imec.be/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_DEFAULT_IDP=https://example.podprovider.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<div> | ||
<h3>Solid Pod URL</h3> | ||
<p>A URL that links to the pod that you want to use.</p> | ||
<aside> | ||
<PhQuestion :size="24" /> | ||
<span> | ||
In order to authenticate, you'll be redirected to the provider's website. | ||
</span> | ||
</aside> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { PhQuestion } from '@phosphor-icons/vue'; | ||
</script> | ||
|
||
<style scoped> | ||
div { | ||
position: absolute; | ||
left: calc(var(--base-unit) * 4); | ||
border: 0.25rem solid var(--solid-purple); | ||
background-color: var(--off-white); | ||
padding: var(--base-unit); | ||
border-radius: var(--base-corner); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
width: 30rem; | ||
} | ||
h2 { | ||
margin-bottom: calc(var(--base-unit) * 2); | ||
} | ||
p { | ||
margin-bottom: calc(var(--base-unit)); | ||
} | ||
aside { | ||
display: flex; | ||
padding: 8px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 8px; | ||
border-radius: var(--base-corner); | ||
background-color: var(--solid-purple); | ||
color: var(--off-white); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<template> | ||
<header> | ||
<h1>{{ title }}</h1> | ||
<p class="tagline" v-if="subtitle">{{ subtitle }}</p> | ||
</header> | ||
<form @submit.prevent="login"> | ||
<fieldset> | ||
<legend> | ||
<span>Solid Pod URL</span> | ||
<PhQuestion :size="24" @mouseover="showPopup = true;" @mouseleave="showPopup = false" /> | ||
</legend> | ||
<label for="solid-pod-url"> | ||
<PhLink :size="24" class="icon" /> | ||
<input type="url" id="solid-pod-url" v-model="solidPodUrl" :placeholder="defaultSolidPodUrl" /> | ||
</label> | ||
<p v-if="showWarning" class="warning">Invalid Solid Pod URL. Please check and try again.</p> | ||
</fieldset> | ||
<fieldset> | ||
<LoButton @click.prevent="noPod" :disabled="isLoading" variant="secondary" :left-icon="PhQuestion"> | ||
No Pod? | ||
</LoButton> | ||
<LoButton type="submit" :disabled="isLoading" :right-icon="PhArrowRight"> | ||
<span v-if="isLoading">Loading...</span> | ||
<span v-else>Login</span> | ||
</LoButton> | ||
</fieldset> | ||
</form> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import { store } from '@/store'; | ||
import { PhArrowRight, PhLink, PhQuestion } from '@phosphor-icons/vue'; | ||
import LoButton from './LoButton.vue'; | ||
defineProps<{ title: string, subtitle?: string }>(); | ||
const showPopup = defineModel<boolean>('showPopup'); | ||
const emit = defineEmits<{ | ||
toggleProvider: [] | ||
}>() | ||
const solidPodUrl = ref<string>(''); | ||
const defaultSolidPodUrl = import.meta.env.VITE_DEFAULT_IDP; | ||
const showWarning = ref<boolean>(false); | ||
const isLoading = ref<boolean>(false); | ||
const login = () => { | ||
isLoading.value = true; | ||
const issuer = solidPodUrl.value.trim() || defaultSolidPodUrl; | ||
store.session.login({ | ||
oidcIssuer: issuer, | ||
redirectUrl: new URL('/home', window.location.href).toString(), | ||
clientName: 'LOAMA', | ||
}) | ||
.then(() => { | ||
showWarning.value = false; | ||
isLoading.value = false; | ||
}) | ||
.catch(() => { | ||
showWarning.value = true; | ||
isLoading.value = false; | ||
}); | ||
}; | ||
const noPod = () => { | ||
emit('toggleProvider'); | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.tagline { | ||
color: var(--off-black); | ||
font-size: calc(var(--base-unit)*4); | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
} | ||
legend { | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
} | ||
span { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
font-weight: 700; | ||
gap: var(--base-unit); | ||
} | ||
label { | ||
display: flex; | ||
position: relative; | ||
flex-grow: 1; | ||
} | ||
.icon { | ||
position: absolute; | ||
left: var(--base-unit); | ||
top: 50%; | ||
margin-top: calc(-1 * var(--base-unit)); | ||
} | ||
input[type="url"] { | ||
padding: 1rem calc(var(--base-unit) + 24px); | ||
width: 100%; | ||
border-color: var(--off-black); | ||
border-radius: var(--base-corner); | ||
} | ||
.warning { | ||
color: var(--lama-red); | ||
} | ||
label, | ||
p, | ||
input { | ||
color: var(--off-black, #170D33); | ||
} | ||
h1, | ||
h2 { | ||
text-align: center; | ||
} | ||
form { | ||
width: 100%; | ||
} | ||
form div { | ||
margin-bottom: 4rem; | ||
} | ||
fieldset { | ||
border: none; | ||
} | ||
fieldset:has(button) { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
button { | ||
width: 45%; | ||
justify-content: center; | ||
} | ||
</style> |
Oops, something went wrong.