fix event for login
This commit is contained in:
parent
a958f53edc
commit
ccc5e67948
5 changed files with 12 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue