dockerize, composte, and various improvements
This commit is contained in:
@@ -1,5 +1,42 @@
|
||||
<script lang="ts" setup>
|
||||
import { useDmStore } from '~/stores/dmStore';
|
||||
import { useServerStore } from '~/stores/serverStore';
|
||||
import { useUserStore } from '~/stores/userStore';
|
||||
import { IChannel, IServer, SafeUser } from '~/types';
|
||||
import { ref } from 'vue';
|
||||
|
||||
definePageMeta({
|
||||
layout: 'clean'
|
||||
});
|
||||
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
const email = ref('');
|
||||
|
||||
async function signup() {
|
||||
if (!username.value || !password.value || !email.value) return;
|
||||
const signupData = await $fetch('/api/signup', {
|
||||
method: 'post', body: {
|
||||
username: username.value,
|
||||
email: email.value,
|
||||
password: password.value
|
||||
},
|
||||
}) as { token: string; user: SafeUser; };
|
||||
|
||||
const token = useCookie('sessionToken');
|
||||
token.value = signupData.token;
|
||||
|
||||
useUserStore().setUser(signupData.user);
|
||||
|
||||
useServerStore().setServers(signupData.user.servers || [] as IServer[]);
|
||||
useDmStore().setDms(signupData.user.channels || [] as IChannel[]);
|
||||
|
||||
return navigateTo('/');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-screen h-screen flex justify-center items-center bg-[var(--primary-bg)]">
|
||||
<div class="w-screen h-screen flex justify-center items-center bg-[var(--primary-bg)] text-[#fefefe]">
|
||||
<div class="bg-[var(--secondary-bg)] rounded-xl shadow-2xl flex flex-row overflow-hidden">
|
||||
<img
|
||||
src="/annie-spratt-8mqOw4DBBSg-unsplash.jpg"
|
||||
@@ -48,49 +85,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { useDmStore } from '~/stores/dmStore';
|
||||
import { useServerStore } from '~/stores/serverStore';
|
||||
import { useUserStore } from '~/stores/userStore';
|
||||
import { IChannel, IServer, SafeUser } from '~/types';
|
||||
|
||||
definePageMeta({
|
||||
layout: 'clean'
|
||||
});
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
username: '',
|
||||
email: '',
|
||||
password: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async signup() {
|
||||
if (!this.username || !this.password || !this.email) return;
|
||||
const signupData = await $fetch('/api/signup', {
|
||||
method: 'post', body: {
|
||||
username: this.username,
|
||||
email: this.email,
|
||||
password: this.password
|
||||
},
|
||||
}) as { token: string; user: SafeUser; };
|
||||
|
||||
const userId = useCookie('userId');
|
||||
userId.value = signupData.user.id;
|
||||
const token = useCookie('sessionToken');
|
||||
token.value = signupData.token;
|
||||
|
||||
useUserStore().setUser(signupData.user);
|
||||
|
||||
useServerStore().setServers(signupData.user.servers || [] as IServer[]);
|
||||
useDmStore().setDms(signupData.user.channels || [] as IChannel[]);
|
||||
|
||||
return navigateTo('/');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</template>
|
||||
Reference in New Issue
Block a user