fix: small fixes

This commit is contained in:
niko
2025-04-21 12:06:27 -04:00
parent 25a298c87d
commit 51d5c3d2e1
2 changed files with 3 additions and 8 deletions

View File

@@ -5,7 +5,7 @@ const route = useRoute();
const redirect = route.query.redirect;
const registerURI = `/account/register${redirect ? `?redirect=${redirect}` : ''}`;
const loginForm = reactive({ username: null, password: null });
const loginForm = reactive({ username: '', password: '' });
const errorMessage = ref<string | null>();
async function loginSubmission() {
@@ -61,12 +61,6 @@ async function loginSubmission() {
class="pwdreset"
>{{ $t("account.loginForm.forgotPassword") }}</a>
</div>
<input
id="redirect"
name="redirect"
type="hidden"
:value="redirect"
>
<div class="buttons">
<button type="submit">
<!-- TODO: loading state on button. ... style maybe? -->

View File

@@ -11,8 +11,9 @@ export default defineEventHandler(async (event) => {
const body = await readBody(event);
try {
const apiResponse = await $fetch<LoginCCResponse>(`${useRuntimeConfig(event).apiBase}/v1/login`, {
const apiResponse = await $fetch<LoginCCResponse>(`/v1/login`, {
method: 'POST',
baseURL: useRuntimeConfig(event).apiBase,
body: { ...body, grant_type: 'password' }
});