Skip to content

Commit

Permalink
Add routes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Sep 24, 2024
1 parent dd1ea89 commit 7ccb3c3
Show file tree
Hide file tree
Showing 24 changed files with 215 additions and 1 deletion.
44 changes: 44 additions & 0 deletions app/assets/router/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const routes = [
{
path: '/account/sign-in',
name: 'account.login',
meta: {
guest: {
redirect: { name: 'home' }
}
},
component: () => import('../views/LoginView.vue')
},
{
path: '/account/register',
name: 'account.register',
meta: {
guest: {
redirect: { name: 'home' }
}
},
component: () => import('../views/RegisterView.vue')
},
{
path: '/account/forgot-password',
name: 'account.forgot-password',
meta: {
guest: {
redirect: { name: 'home' }
}
},
component: () => import('../views/ForgotPasswordView.vue')
},
{
path: '/account/resend-verification',
name: 'account.resend-verification',
meta: {
guest: {
redirect: { name: 'home' }
}
},
component: () => import('../views/ResendVerificationView.vue')
}
]

export default routes
3 changes: 3 additions & 0 deletions app/assets/views/ForgotPasswordView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<UFPageForgotPassword />
</template>
11 changes: 11 additions & 0 deletions app/assets/views/LoginView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
const router = useRouter()
</script>

<template>
<UFPageLogin
@goto-registration="router.push({ name: 'account.register' })"
@goto-forgot-password="router.push({ name: 'account.forgot-password' })"
@goto-resend-verification="router.push({ name: 'account.resend-verification' })" />
</template>
8 changes: 8 additions & 0 deletions app/assets/views/RegisterView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
const router = useRouter()
</script>

<template>
<UFPageRegister @goto-login="router.push({ name: 'account.login' })" />
</template>
3 changes: 3 additions & 0 deletions app/assets/views/ResendVerificationView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<UFPageResendVerification />
</template>
11 changes: 11 additions & 0 deletions dist/ForgotPasswordView-Ct0WfO54.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { resolveComponent as r, openBlock as e, createBlock as t } from "vue";
import { _ as s } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const c = {};
function n(a, _) {
const o = r("UFPageForgotPassword");
return e(), t(o);
}
const p = /* @__PURE__ */ s(c, [["render", n]]);
export {
p as default
};
1 change: 1 addition & 0 deletions dist/ForgotPasswordView-Do1jt-vY.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),t={};function n(s,_){const o=e.resolveComponent("UFPageForgotPassword");return e.openBlock(),e.createBlock(o)}const c=r._export_sfc(t,[["render",n]]);exports.default=c;
19 changes: 19 additions & 0 deletions dist/LoginView-DgGcaGh5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineComponent as s, resolveComponent as i, openBlock as p, createBlock as u, unref as n } from "vue";
import { useRouter as a } from "vue-router";
const d = /* @__PURE__ */ s({
__name: "LoginView",
setup(m) {
const e = a();
return (f, o) => {
const r = i("UFPageLogin");
return p(), u(r, {
onGotoRegistration: o[0] || (o[0] = (t) => n(e).push({ name: "account.register" })),
onGotoForgotPassword: o[1] || (o[1] = (t) => n(e).push({ name: "account.forgot-password" })),
onGotoResendVerification: o[2] || (o[2] = (t) => n(e).push({ name: "account.resend-verification" }))
});
};
}
});
export {
d as default
};
1 change: 1 addition & 0 deletions dist/LoginView-DwEVPIza.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("vue-router"),s=e.defineComponent({__name:"LoginView",setup(i){const n=u.useRouter();return(a,o)=>{const r=e.resolveComponent("UFPageLogin");return e.openBlock(),e.createBlock(r,{onGotoRegistration:o[0]||(o[0]=t=>e.unref(n).push({name:"account.register"})),onGotoForgotPassword:o[1]||(o[1]=t=>e.unref(n).push({name:"account.forgot-password"})),onGotoResendVerification:o[2]||(o[2]=t=>e.unref(n).push({name:"account.resend-verification"}))})}}});exports.default=s;
1 change: 1 addition & 0 deletions dist/RegisterView-BX7SoD5B.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("vue-router"),u=e.defineComponent({__name:"RegisterView",setup(s){const t=r.useRouter();return(c,o)=>{const n=e.resolveComponent("UFPageRegister");return e.openBlock(),e.createBlock(n,{onGotoLogin:o[0]||(o[0]=i=>e.unref(t).push({name:"account.login"}))})}}});exports.default=u;
17 changes: 17 additions & 0 deletions dist/RegisterView-D9MTwaNP.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineComponent as n, resolveComponent as r, openBlock as s, createBlock as p, unref as i } from "vue";
import { useRouter as m } from "vue-router";
const f = /* @__PURE__ */ n({
__name: "RegisterView",
setup(u) {
const o = m();
return (c, e) => {
const t = r("UFPageRegister");
return s(), p(t, {
onGotoLogin: e[0] || (e[0] = (a) => i(o).push({ name: "account.login" }))
});
};
}
});
export {
f as default
};
11 changes: 11 additions & 0 deletions dist/ResendVerificationView-BBUXSJO0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { resolveComponent as o, openBlock as n, createBlock as c } from "vue";
import { _ as r } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const t = {};
function i(s, a) {
const e = o("UFPageResendVerification");
return n(), c(e);
}
const m = /* @__PURE__ */ r(t, [["render", i]]);
export {
m as default
};
1 change: 1 addition & 0 deletions dist/ResendVerificationView-D4anMPwm.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),t={};function r(i,s){const n=e.resolveComponent("UFPageResendVerification");return e.openBlock(),e.createBlock(n)}const c=o._export_sfc(t,[["render",r]]);exports.default=c;
1 change: 1 addition & 0 deletions dist/_plugin-vue_export-helper-BHFhmbuH.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";const e=(t,o)=>{const c=t.__vccOpts||t;for(const[r,s]of o)c[r]=s;return c};exports._export_sfc=e;
9 changes: 9 additions & 0 deletions dist/_plugin-vue_export-helper-CHgC5LLL.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const s = (t, r) => {
const o = t.__vccOpts || t;
for (const [c, e] of r)
o[c] = e;
return o;
};
export {
s as _
};
13 changes: 13 additions & 0 deletions dist/router/routes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
declare const routes: {
path: string;
name: string;
meta: {
guest: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/RegisterView.vue")>;
}[];
export default routes;
1 change: 1 addition & 0 deletions dist/routes.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"/account/sign-in",name:"account.login",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./LoginView-DwEVPIza.cjs"))},{path:"/account/register",name:"account.register",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./RegisterView-BX7SoD5B.cjs"))},{path:"/account/forgot-password",name:"account.forgot-password",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./ForgotPasswordView-Do1jt-vY.cjs"))},{path:"/account/resend-verification",name:"account.resend-verification",meta:{guest:{redirect:{name:"home"}}},component:()=>Promise.resolve().then(()=>require("./ResendVerificationView-D4anMPwm.cjs"))}];exports.default=e;
45 changes: 45 additions & 0 deletions dist/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const e = [
{
path: "/account/sign-in",
name: "account.login",
meta: {
guest: {
redirect: { name: "home" }
}
},
component: () => import("./LoginView-DgGcaGh5.js")
},
{
path: "/account/register",
name: "account.register",
meta: {
guest: {
redirect: { name: "home" }
}
},
component: () => import("./RegisterView-D9MTwaNP.js")
},
{
path: "/account/forgot-password",
name: "account.forgot-password",
meta: {
guest: {
redirect: { name: "home" }
}
},
component: () => import("./ForgotPasswordView-Ct0WfO54.js")
},
{
path: "/account/resend-verification",
name: "account.resend-verification",
meta: {
guest: {
redirect: { name: "home" }
}
},
component: () => import("./ResendVerificationView-BBUXSJO0.js")
}
];
export {
e as default
};
2 changes: 2 additions & 0 deletions dist/views/ForgotPasswordView.vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
export default _default;
2 changes: 2 additions & 0 deletions dist/views/LoginView.vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
export default _default;
2 changes: 2 additions & 0 deletions dist/views/RegisterView.vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
export default _default;
2 changes: 2 additions & 0 deletions dist/views/ResendVerificationView.vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
export default _default;
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
"require": "./dist/guards.cjs",
"types": "./dist/guards/authGuard.d.ts"
},
"./routes": {
"import": "./dist/routes.js",
"require": "./dist/routes.cjs",
"types": "./dist/router/routes.d.ts"
},
"./*": "./app/assets/*"
},
"files": [
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default defineConfig({
composables: 'app/assets/composables/index.ts',
types: 'app/assets/interfaces/index.ts',
guards: 'app/assets/guards/authGuard.ts',
stores: 'app/assets/stores/auth.ts'
stores: 'app/assets/stores/auth.ts',
routes: 'app/assets/router/routes.ts'
}
},
rollupOptions: {
Expand Down

0 comments on commit 7ccb3c3

Please sign in to comment.