fix: sign in post working

This commit is contained in:
Zack Spear
2023-06-20 10:36:54 -05:00
parent 10a573fb4d
commit ecfe0ec2f9
4 changed files with 15 additions and 15 deletions
+9 -12
View File
@@ -23,18 +23,17 @@ const { updating, updateSuccess } = storeToRefs(accountStore);
const { callbackLoading } = storeToRefs(callbackActionsStore);
const { keyUrl, installing, success } = storeToRefs(installKeyStore);
const heading = computed(() => {
callbackLoading.value ? 'Performing actions' : 'Finished performing actions';
});
const subheading = computed(() => {
callbackLoading.value ? 'Please keep this window open' : '';
});
const heading = computed(() => callbackLoading.value ? 'Performing actions' : 'Finished performing actions');
const subheading = computed(() => callbackLoading.value ? 'Please keep this window open' : '');
const close = () => {
if (callbackLoading.value) return console.debug('[close] not allowed');
callbackActionsStore.closeCallbackFeedback();
};
// @close="close"
// :show-close-x="!callbackLoading"
const reload = () => window.location.reload();
const { text, copy, copied, isSupported } = useClipboard({ source: keyUrl.value });
</script>
@@ -42,11 +41,9 @@ const { text, copy, copied, isSupported } = useClipboard({ source: keyUrl.value
<template>
<Modal
:open="open"
@close="close"
max-width="max-w-800px"
:show-close-x="!callbackLoading"
>
<div class="text-center relative w-full flex flex-col gap-y-16px">
<div class="text-16px text-center relative w-full flex flex-col gap-y-16px">
<header>
<h1 class="text-24px font-semibold">{{ heading }}</h1>
<p v-if="subheading" class="text-16px opacity-80">{{ subheading }}</p>
@@ -77,10 +74,10 @@ const { text, copy, copied, isSupported } = useClipboard({ source: keyUrl.value
<div v-if="!callbackLoading" class="w-full max-w-xs flex flex-col gap-y-16px mx-auto">
<button
@click="close"
@click="reload"
class="text-12px tracking-wide inline-block mx-8px opacity-60 hover:opacity-100 focus:opacity-100 underline transition"
>
{{ 'Close' }}
{{ 'Reload Page to Finalize' }}
</button>
</div>
</div>
+2 -1
View File
@@ -12,8 +12,9 @@ export const WebguiInstallKey = request.url('/webGui/include/InstallKey.php');
* @param {string} csrf_token
* @param {string} '#file' - ex: getters.myServersCfgPath
* @param {string} '#section' - ex: 'remote'
* @param {string} apikey
* @param {string} apikey - from key server's response
* @param {string} avatar
* @param {string} regWizTime - date_guid
* @param {string} email
* @param {string} username
*/
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* @todo setup .env
*/
const ACCOUNT = 'https://localhost:8008/connect';
const ACCOUNT = 'https://localhost:8008';
const CONNECT_DOCS = 'https://docs.unraid.net/category/unraid-connect';
const CONNECT_DASHBOARD = 'https://connect.myunraid.net';
const DEV_GRAPH_URL = '';
+3 -1
View File
@@ -2,6 +2,7 @@ import { defineStore, createPinia, setActivePinia } from 'pinia';
import { useCallbackStore } from './callbackActions';
import { useServerStore } from './server';
import { WebguiUpdate } from '~/composables/services/webgui';
import { ACCOUNT_CALLBACK } from '~/helpers/urls';
import type { CallbackAction } from '~/types/callback';
/**
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
@@ -64,7 +65,8 @@ export const useAccountStore = defineStore('account', () => {
const userPayload = {
...(action.user
? {
apikey: serverStore.apiKey,
apikey: action.apiKey,
// avatar: '',
email: action.user?.email,
regWizTime: `${Date.now()}_${serverStore.guid}`, // set when signing in the first time and never unset for the sake of displaying Sign In/Up in the UPC without needing to validate guid every time
username: action.user?.preferred_username,