fix event for login

This commit is contained in:
Andrew Gundersen 2021-02-12 10:39:42 -06:00
commit ccc5e67948
5 changed files with 12 additions and 13 deletions

View file

@ -35,12 +35,13 @@ const authSession = async (_event, payload: string | UserCreds | null): Promise<
console.log('authenticating...');
backgroundMitt.on('auth-res', (res: string) => {
backgroundMitt.once('auth-res', (res: string) => {
if (res === 'locked') {
reject(res);
} else {
auth = true;
console.log(res);
resolve(res);
}

View file

@ -12,16 +12,16 @@ import { useAuth } from '@/modules/auth';
const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "splash",
component: Splash,
meta: { requiresAuth: false },
},
{
path: "/home",
name: "home",
component: Home,
meta: { requiresAuth: true },
},
{
path: "/splash",
name: "splash",
component: Splash,
meta: { requiresAuth: false },
},
{
path: "/login",
name: "login",

View file

@ -18,10 +18,10 @@
<label for="checkbox">Remember Me</label> -->
<!-- submit button; position: fixed -->
<button class="button" @click="submit">Submit</button>
<button class="button" @click.prevent="submit">Submit</button>
<!-- back to login button: position: fixed -->
<button class="button2" @click="switchView">Create an account</button>
<button class="button2" @click.prevent="switchView">Create an account</button>
</form>
</template>

View file

@ -18,10 +18,10 @@
</div>
<!-- submit button; position: fixed -->
<button class="button" @click="submit">Submit</button>
<button class="button" @click.prevent="submit">Submit</button>
<!-- back to login button: position: fixed -->
<button class="button2" @click="switchView">Back to login</button>
<button class="button2" @click.prevent="switchView">Back to login</button>
</div>
</template>

View file

@ -47,12 +47,10 @@
<script lang="ts">
import { defineComponent } from "vue";
import SplashComponent from "@/components/splash/index.vue"
export default defineComponent({
name: "Splash",
components: { SplashComponent },
});