Skip to content

Commit

Permalink
some corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Oct 16, 2024
1 parent e1241e6 commit 9d3e45f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 17 deletions.
29 changes: 29 additions & 0 deletions default.cert
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIFCTCCAvGgAwIBAgIUbvD0dvnZOCfstZkE6ByRwYah4VMwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MTAxNjA4NDM0OFoXDTI1MTAx
NjA4NDM0OFowFDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEF
AAOCAg8AMIICCgKCAgEApiFVMNAFtrai9s/xP+kYxsa7NzmPBlJg07MsFlW7JPek
FMAy/4HSSZd8gG3fWz73U3cy4J+Oecdy3O0T708ImVBcYskN/Hi/JCBuTRSJZqH4
SlFFqoqR5E8H1bVDL9l4QQgWqoBzNiAEwBMlPSTAeoL91a02qYIPTNjVx93d+1Ua
eGq3/4HhYxogD6vjJOol32T2Twe7xMJ2j4IIsaQLvprA05HhYpJOxRkeuJQO7TEv
o5VcwxURtKm15z8GN6Fj0/MQ/edvj6l59g4ywtNeqIKyQHq/B9QVsfYQIK3HA9j/
Z5cVEfvMjhMl2x6Bh29npg2DRWiucRJioEwRYsxP5G8DO6f0maP+siY8lZrrioxV
LVbyz4z6skFSoGR0lY59oe4+V4UR8Djww/WxuzmI8UJFT0/2cV1ux8mY/UAePjUo
HOzkUn7E669eabRldcBzWpb0ocmeufPdi+LWGHvZxE4v3iUVsxv+GgH7QAYy2LV3
XW5PwHGEMbOkrb772oe13IEYiXCXKgPheI26u3dw6LUKk9V2w+aGvjfjY7IQMDZy
kZ6r5XdLeyUMYfu2UEs+8e8WTW+DYade35k9Hd2AWYYjoGeUjEoht1KKVA9cTyMg
Mf34u40bR5xb9TRLSZc9ZR3OBIIT3gea0gdNQ59XBwRHzcdW1bgOARFcYGcjWOkC
AwEAAaNTMFEwHQYDVR0OBBYEFJS1zAOTGWa0+TgIne/tFIk2h3dsMB8GA1UdIwQY
MBaAFJS1zAOTGWa0+TgIne/tFIk2h3dsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
hvcNAQELBQADggIBACAc9yR77JcUdFYPqVwwkm/hLPTKzcJCEgUZ/8MuYk8CEDxf
ZPeckksEaKHOCi4R6pUqGRudQ7+jW7z9+1zU4iS3s6TxoydTuIFIWlVWfvlCRtWi
CldfpHJH/fw8c7g0pV5neEMKmA1E2tNz8escjSqIDy8Ow8TUbZQvupId+izIg705
gd5Bjb88WlGsEIEY7myIgU7MvSFwv2hogqUGomjJIv9dArOS3hDcLoFcL5Nb3W7/
CqLgwOUPsLy+/bS8DvYe3Q6knPUmiPYA+jI0XNYmDqadrv00/5sYKEU27dKsu2RZ
GSD+M0cgxrDfO+hthlYVefak0edz0T3WYxVc+PFGmm6CjDd0Y2iCabaAID8RJzEf
GUwZRbrF0sQWWwvwxtMUvxvCY1I8N1gTFYaH6mDPPYPd72Cbu5UBtsOg1SHJ3WuE
rSUWgkjieQIS87kDMgFKcgrUUogkkivJhXy0dBWDQAZtHbG5qUuqypRlmGgST1zI
aRQD+tIR8aY6lsG8GAGXrSXA8YOyDHNwkR+7LpC6eNi96GDbOJdy6aF7qmJ3beRw
vP5MDwsITZp9BM3IofFQVS7MVEuPQ71plM/aqM5Jf0tqZFpzPN3S+udycyzHfPrK
5OBU6MSaClmyrsTjsh0TjCdOVZrX1nNvfg+2WlfzMn9XfQlpd+iXbjuShFuP
-----END CERTIFICATE-----
3 changes: 1 addition & 2 deletions frontend/src/lib/components/UserLandingPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { onDestroy } from 'svelte';
console.log('user: ', get(currentUser));
const isVerifed = get(currentUser)?.is_verified;
let currentPersonal = 'userDataInput';
let currentChildren = 'childrenGallery';
Expand All @@ -25,8 +26,6 @@
unsubscribeChildren();
unsubscribePersonal();
});
console.log('user: ', get(currentUser));
console.log(' verified: ', isVerifed);
</script>

{#if isVerifed === true}
Expand Down
12 changes: 3 additions & 9 deletions frontend/src/lib/components/UserLogin.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
const returned = await usersCurrentUser();
if (returned.error) {
console.log('Error getting current user: ', returned.error.detail);
currentUser.set(null as unknown as UserRead);
currentUser.set(null);
return returned.error.detail;
} else {
console.log('Successfully retrieved active user');
// TODO: remove this in the final version, this sets verified to true
// to emulate a successful user registration
returned.data.is_verified = true;
currentUser.set(returned.data as UserRead);
return 'success';
}
Expand All @@ -42,9 +39,6 @@
// forget user data again to not have a plain text password lying around in memory somewhere
// any longer than needed
formData.forEach((element) => {
element.value = '';
});
if (authReturn.error) {
showAlert = true;
Expand Down Expand Up @@ -130,7 +124,7 @@
<UserLoginUtil cls="p-6 mb-3" bind:checked={remember} />

<Button
class="dark:bg-primay-700 w-full bg-primary-700 text-center text-sm text-white hover:bg-primary-800 hover:text-white dark:hover:bg-primary-800"
class="dark:bg-primay-700 bg-primary-700 hover:bg-primary-800 dark:hover:bg-primary-800 w-full text-center text-sm text-white hover:text-white"
type="submit">{$_('login.submitButtonLabel')}</Button
>
</form>
Expand All @@ -139,7 +133,7 @@
<span class="container mx-auto w-full text-gray-700 dark:text-gray-400">Not registered?</span>
<a
href={`${base}/userLand/userRegistration`}
class="text-primary-700 hover:underline dark:text-primary-500"
class="text-primary-700 dark:text-primary-500 hover:underline"
>
Create account
</a>
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/lib/components/UserRegistration.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
userData.body.is_active = true;
const result = await registerRegister(userData);
data.forEach((element) => {
element.value = '';
});
if (result.error) {
console.log('error: ', result.response.status, result.error.detail);
alertMessage = $_('registration.alertMessageError') + ': ' + result.error.detail;
Expand Down Expand Up @@ -99,7 +97,7 @@
return { name: String(v), value: v };
})
},
value: ''
value: $_('registration.observerRole')
}
];
Expand Down Expand Up @@ -147,7 +145,7 @@

<Button
type="submit"
class="dark:bg-primay-700 w-full bg-primary-700 text-center text-sm text-white hover:bg-primary-800 hover:text-white dark:hover:bg-primary-800"
class="dark:bg-primay-700 bg-primary-700 hover:bg-primary-800 dark:hover:bg-primary-800 w-full text-center text-sm text-white hover:text-white"
>{$_('registration.submitButtonLabel')}</Button
>
</form>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/stores/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ async function hash(input: string): string {
return hash;
}

const currentUser = writable(null as unknown as UserRead);
const currentUser = writable(null as null | UserRead);

export { createDummyUser, currentUser, hash, users, UserStore, type UserData, type UserList };

0 comments on commit 9d3e45f

Please sign in to comment.