Commit a227deeb authored by Arthur.Pautrel's avatar Arthur.Pautrel
Browse files

Login/Register with the frontend reworks

parent 4a5c02fd
......@@ -5,7 +5,7 @@ const joiValidation = (schema) => {
const body = req.body;
await schema.validateAsync(body);
} catch (err) {
return res.json({ success: false, error: err})
return res.json({ success: false, error: err.details[0].message})
}
next();
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-background: var(--vt-c-white);--color-background-soft: var(--vt-c-white-soft);--color-background-mute: var(--vt-c-white-mute);--color-border: var(--vt-c-divider-light-2);--color-border-hover: var(--vt-c-divider-light-1);--color-heading: var(--vt-c-text-light-1);--color-text: var(--vt-c-text-light-1);--section-gap: 160px}@media (prefers-color-scheme: dark){:root{--color-background: var(--vt-c-black);--color-background-soft: var(--vt-c-black-soft);--color-background-mute: var(--vt-c-black-mute);--color-border: var(--vt-c-divider-dark-2);--color-border-hover: var(--vt-c-divider-dark-1);--color-heading: var(--vt-c-text-dark-1);--color-text: var(--vt-c-text-dark-2)}}*,*:before,*:after{box-sizing:border-box;margin:0;position:relative;font-weight:400}body{min-height:100vh;color:var(--color-text);background:var(--color-background);transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.border{border-width:1px;border-style:solid;border-color:#000;border-radius:30px;padding:15px}#submitButton{background-color:#41b883;border-color:#41b883;border-radius:10px;border-style:solid;color:#fff;width:100%;height:40px}#app{max-width:1280px;margin:0 auto;padding:2rem;font-weight:400}header{line-height:1.5;max-height:100vh}.logo{display:block;margin:0 auto 2rem}a,.green{text-decoration:none;color:#00bd7e;transition:.4s}@media (hover: hover){a:hover{background-color:#00bd7e33}}nav{width:100%;font-size:12px;text-align:center;margin-top:2rem}nav a.router-link-exact-active{color:var(--color-text)}nav a.router-link-exact-active:hover{background-color:transparent}nav a{display:inline-block;padding:0 1rem;border-left:1px solid var(--color-border)}nav a:first-of-type{border:0}@media (min-width: 1024px){body{display:flex;place-items:center}#app{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem}header{display:flex;place-items:center;padding-right:calc(var(--section-gap) / 2)}header .wrapper{display:flex;place-items:flex-start;flex-wrap:wrap}.logo{margin:0 2rem 0 0}nav{text-align:left;margin-left:-1rem;font-size:1rem;padding:1rem 0;margin-top:1rem}}#loginLogo[data-v-78453644]{width:50%;display:block;margin-right:auto;margin-left:auto}#textAboveSignup[data-v-8c7f31be]{font-size:70%}
import{o as d,c as _,a as t,b as p,u as f,R as h,w as g,d as U,F as v,e as y,f as i,v as c,p as x,g as N,h as $,i as L,j as k,k as V,l as P}from"./vendor.889f8038.js";const R=function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))u(e);new MutationObserver(e=>{for(const n of e)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&u(o)}).observe(document,{childList:!0,subtree:!0});function l(e){const n={};return e.integrity&&(n.integrity=e.integrity),e.referrerpolicy&&(n.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?n.credentials="include":e.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function u(e){if(e.ep)return;e.ep=!0;const n=l(e);fetch(e.href,n)}};R();const M=y("Login"),O=y("Register"),S=y("Market"),T={setup(r){return(s,l)=>(d(),_(v,null,[t("header",null,[t("nav",null,[p(f(h),{to:"/"},{default:g(()=>[M]),_:1}),p(f(h),{to:"/register"},{default:g(()=>[O]),_:1}),p(f(h),{to:"/market"},{default:g(()=>[S]),_:1})])]),p(f(U))],64))}};var E="/assets/loginLogo.4c8cccd3.png";var b=(r,s)=>{const l=r.__vccOpts||r;for(const[u,e]of s)l[u]=e;return l};const I={data(){return{email:"",password:""}}},m=r=>(x("data-v-78453644"),r=r(),N(),r),Q=m(()=>t("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css",integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"},null,-1)),j={class:"border"},B=m(()=>t("img",{id:"loginLogo",src:E},null,-1)),C={class:"form-group"},F=m(()=>t("label",null,"Username",-1)),A={class:"form-group"},J=m(()=>t("label",null,"Password",-1)),X=m(()=>t("button",{id:"submitButton",type:"submit"},"Login",-1));function D(r,s,l,u,e,n){return d(),_(v,null,[Q,t("div",j,[B,t("div",C,[F,i(t("input",{class:"form-control","onUpdate:modelValue":s[0]||(s[0]=o=>e.email=o),placeholder:"Enter Username"},null,512),[[c,e.email]])]),t("div",A,[J,i(t("input",{class:"form-control",type:"password","onUpdate:modelValue":s[1]||(s[1]=o=>e.password=o),placeholder:"Enter Password"},null,512),[[c,e.password]])]),X])],64)}var H=b(I,[["render",D],["__scopeId","data-v-78453644"]]);const W={setup(r){return(s,l)=>(d(),_("main",null,[p(H)]))}};const Y={data(){return{email:"",username:"",firstName:"",lastName:"",password:"",repeatPassword:""}}},a=r=>(x("data-v-8c7f31be"),r=r(),N(),r),Z=a(()=>t("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css",integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"},null,-1)),q={class:"border"},K=a(()=>t("h2",null,"Sign Up",-1)),z=a(()=>t("p",{id:"textAboveSignup"},"Please fill in the form to create an account",-1)),G={class:"form-group"},ee=a(()=>t("label",null,"Email",-1)),te={class:"form-group"},se=a(()=>t("label",null,"Username",-1)),oe={class:"form-group"},re=a(()=>t("label",null,"First Name",-1)),ne={class:"form-group"},le=a(()=>t("label",null,"Last Name",-1)),ae={class:"form-group"},ie=a(()=>t("label",null,"Password",-1)),ce={class:"form-group"},ue=a(()=>t("label",null,"Repeat Password",-1)),pe=a(()=>t("button",{id:"submitButton",type:"submit"},"Sign Up",-1));function de(r,s,l,u,e,n){return d(),_(v,null,[Z,t("div",q,[K,z,t("div",G,[ee,i(t("input",{class:"form-control",type:"email","onUpdate:modelValue":s[0]||(s[0]=o=>e.email=o),placeholder:"Enter Email"},null,512),[[c,e.email]])]),t("div",te,[se,i(t("input",{class:"form-control","onUpdate:modelValue":s[1]||(s[1]=o=>e.username=o),placeholder:"Username"},null,512),[[c,e.username]])]),t("div",oe,[re,i(t("input",{class:"form-control","onUpdate:modelValue":s[2]||(s[2]=o=>e.firstName=o),placeholder:"First Name"},null,512),[[c,e.firstName]])]),t("div",ne,[le,i(t("input",{class:"form-control","onUpdate:modelValue":s[3]||(s[3]=o=>e.lastName=o),placeholder:"Last Name"},null,512),[[c,e.lastName]])]),t("div",ae,[ie,i(t("input",{class:"form-control",type:"password","onUpdate:modelValue":s[4]||(s[4]=o=>e.password=o),placeholder:"Create your Password"},null,512),[[c,e.password]])]),t("div",ce,[ue,i(t("input",{class:"form-control",type:"password","onUpdate:modelValue":s[5]||(s[5]=o=>e.repeatPassword=o),placeholder:"Create your Password"},null,512),[[c,e.repeatPassword]])]),pe])],64)}var _e=b(Y,[["render",de],["__scopeId","data-v-8c7f31be"]]);const me={setup(r){return(s,l)=>(d(),_("main",null,[p(_e)]))}},fe={data(){return{email:""}}};function he(r,s,l,u,e,n){return d(),_("h2",null,"Market Vue")}var ge=b(fe,[["render",he]]);const ve={setup(r){return(s,l)=>(d(),_("main",null,[p(ge)]))}},ye=$({history:L("/"),routes:[{path:"/",name:"login",component:W},{path:"/register",name:"register",component:me},{path:"/market",name:"market",component:ve}]}),w=k(T);w.use(ye);w.use(V,P);w.mount("#app");
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" crossorigin src="/assets/index.a0a51ae3.js"></script>
<link rel="modulepreload" href="/assets/vendor.889f8038.js">
<link rel="stylesheet" href="/assets/index.24e5f623.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
......@@ -135,6 +135,14 @@
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz",
"integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ=="
},
"node_modules/axios": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"dependencies": {
"follow-redirects": "^1.14.8"
}
},
"node_modules/csstype": {
"version": "2.6.20",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz",
......@@ -196,6 +204,25 @@
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
},
"node_modules/follow-redirects": {
"version": "1.14.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
......@@ -387,6 +414,15 @@
"@vue/shared": "3.2.31"
}
},
"node_modules/vue-axios": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/vue-axios/-/vue-axios-3.4.1.tgz",
"integrity": "sha512-8YZYUOQrBEJktxoQtrM4rr2LfVcDaWfJqv8MqtLlgLlkuBvCYKFSZSo6AXQ4YcCzdgccDqstmuaEh68lcH9xWA==",
"peerDependencies": {
"axios": ">= 0.20.0",
"vue": "^3.0.0 || ^2.0.0"
}
},
"node_modules/vue-router": {
"version": "4.0.13",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.13.tgz",
......
{
"hash": "3a498a3b",
"browserHash": "2a998c33",
"hash": "a57280a8",
"browserHash": "4147ffb3",
"optimized": {
"vue-axios": {
"file": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/.vite/vue-axios.js",
"src": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/vue-axios/dist/vue-axios.esm.min.js",
"needsInterop": false
},
"vue": {
"file": "/home/kelvez/Internet_Programing/TP08/ex01/node_modules/.vite/vue.js",
"src": "/home/kelvez/Internet_Programing/TP08/ex01/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/.vite/vue.js",
"src": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"needsInterop": false
},
"axios": {
"file": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/.vite/axios.js",
"src": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/axios/index.js",
"needsInterop": true
},
"vue-router": {
"file": "/home/kelvez/Internet_Programing/TP08/ex01/node_modules/.vite/vue-router.js",
"src": "/home/kelvez/Internet_Programing/TP08/ex01/node_modules/vue-router/dist/vue-router.esm-bundler.js",
"file": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/.vite/vue-router.js",
"src": "/home/kelvez/Internet_Programing/TP11/frontend/node_modules/vue-router/dist/vue-router.esm-bundler.js",
"needsInterop": false
}
}
......
This diff is collapsed.
This diff is collapsed.
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
export {
__commonJS
};
//# sourceMappingURL=chunk-76J2PTFD.js.map
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}
import "./chunk-76J2PTFD.js";
// node_modules/vue-axios/dist/vue-axios.esm.min.js
function _typeof(e) {
return (_typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e2) {
return typeof e2;
} : function(e2) {
return e2 && typeof Symbol == "function" && e2.constructor === Symbol && e2 !== Symbol.prototype ? "symbol" : typeof e2;
})(e);
}
function plugin(e, n) {
if (!e.vueAxiosInstalled) {
var o = isAxiosLike(n) ? migrateToMultipleInstances(n) : n;
if (isValidConfig(o)) {
var t = getVueVersion(e);
if (t) {
var i = t < 3 ? registerOnVue2 : registerOnVue3;
Object.keys(o).forEach(function(n2) {
i(e, n2, o[n2]);
}), e.vueAxiosInstalled = true;
} else
console.error("[vue-axios] unknown Vue version");
} else
console.error("[vue-axios] configuration is invalid, expected options are either <axios_instance> or { <registration_key>: <axios_instance> }");
}
}
function registerOnVue2(e, n, o) {
Object.defineProperty(e.prototype, n, { get: function() {
return o;
} }), e[n] = o;
}
function registerOnVue3(e, n, o) {
e.config.globalProperties[n] = o, e[n] = o;
}
function isAxiosLike(e) {
return e && typeof e.get == "function" && typeof e.post == "function";
}
function migrateToMultipleInstances(e) {
return { axios: e, $http: e };
}
function isValidConfig(e) {
return _typeof(e) === "object" && Object.keys(e).every(function(n) {
return isAxiosLike(e[n]);
});
}
function getVueVersion(e) {
return e && e.version && Number(e.version.split(".")[0]);
}
(typeof exports == "undefined" ? "undefined" : _typeof(exports)) == "object" ? module.exports = plugin : typeof define == "function" && define.amd ? define([], function() {
return plugin;
}) : window.Vue && window.axios && window.Vue.use && Vue.use(plugin, window.axios);
// dep:vue-axios
var vue_axios_default = plugin;
export {
vue_axios_default as default
};
//# sourceMappingURL=vue-axios.js.map
{
"version": 3,
"sources": ["../vue-axios/dist/vue-axios.esm.min.js", "dep:vue-axios"],
"sourcesContent": ["function _typeof(e){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function plugin(e,n){if(!e.vueAxiosInstalled){var o=isAxiosLike(n)?migrateToMultipleInstances(n):n;if(isValidConfig(o)){var t=getVueVersion(e);if(t){var i=t<3?registerOnVue2:registerOnVue3;Object.keys(o).forEach((function(n){i(e,n,o[n])})),e.vueAxiosInstalled=!0}else console.error(\"[vue-axios] unknown Vue version\")}else console.error(\"[vue-axios] configuration is invalid, expected options are either <axios_instance> or { <registration_key>: <axios_instance> }\")}}function registerOnVue2(e,n,o){Object.defineProperty(e.prototype,n,{get:function(){return o}}),e[n]=o}function registerOnVue3(e,n,o){e.config.globalProperties[n]=o,e[n]=o}function isAxiosLike(e){return e&&\"function\"==typeof e.get&&\"function\"==typeof e.post}function migrateToMultipleInstances(e){return{axios:e,$http:e}}function isValidConfig(e){return\"object\"===_typeof(e)&&Object.keys(e).every((function(n){return isAxiosLike(e[n])}))}function getVueVersion(e){return e&&e.version&&Number(e.version.split(\".\")[0])}\"object\"==(\"undefined\"==typeof exports?\"undefined\":_typeof(exports))?module.exports=plugin:\"function\"==typeof define&&define.amd?define([],(function(){return plugin})):window.Vue&&window.axios&&window.Vue.use&&Vue.use(plugin,window.axios);export{plugin as default};", "import d from \"./node_modules/vue-axios/dist/vue-axios.esm.min.js\";export default d;"],
"mappings": ";;;AAAA,iBAAiB,GAAE;AAAC,SAAO,WAAQ,AAAY,OAAO,UAAnB,cAA2B,AAAU,OAAO,OAAO,YAAxB,WAAiC,SAAS,IAAE;AAAC,WAAO,OAAO;AAAA,EAAC,IAAE,SAAS,IAAE;AAAC,WAAO,MAAG,AAAY,OAAO,UAAnB,cAA2B,GAAE,gBAAc,UAAQ,OAAI,OAAO,YAAU,WAAS,OAAO;AAAA,EAAC,GAAG,CAAC;AAAC;AAAC,gBAAgB,GAAE,GAAE;AAAC,MAAG,CAAC,EAAE,mBAAkB;AAAC,QAAI,IAAE,YAAY,CAAC,IAAE,2BAA2B,CAAC,IAAE;AAAE,QAAG,cAAc,CAAC,GAAE;AAAC,UAAI,IAAE,cAAc,CAAC;AAAE,UAAG,GAAE;AAAC,YAAI,IAAE,IAAE,IAAE,iBAAe;AAAe,eAAO,KAAK,CAAC,EAAE,QAAS,SAAS,IAAE;AAAC,YAAE,GAAE,IAAE,EAAE,GAAE;AAAA,QAAC,CAAE,GAAE,EAAE,oBAAkB;AAAA,MAAE;AAAM,gBAAQ,MAAM,iCAAiC;AAAA,IAAC;AAAM,cAAQ,MAAM,gIAAgI;AAAA,EAAC;AAAC;AAAC,wBAAwB,GAAE,GAAE,GAAE;AAAC,SAAO,eAAe,EAAE,WAAU,GAAE,EAAC,KAAI,WAAU;AAAC,WAAO;AAAA,EAAC,EAAC,CAAC,GAAE,EAAE,KAAG;AAAC;AAAC,wBAAwB,GAAE,GAAE,GAAE;AAAC,IAAE,OAAO,iBAAiB,KAAG,GAAE,EAAE,KAAG;AAAC;AAAC,qBAAqB,GAAE;AAAC,SAAO,KAAG,AAAY,OAAO,EAAE,OAArB,cAA0B,AAAY,OAAO,EAAE,QAArB;AAAyB;AAAC,oCAAoC,GAAE;AAAC,SAAM,EAAC,OAAM,GAAE,OAAM,EAAC;AAAC;AAAC,uBAAuB,GAAE;AAAC,SAAM,AAAW,QAAQ,CAAC,MAApB,YAAuB,OAAO,KAAK,CAAC,EAAE,MAAO,SAAS,GAAE;AAAC,WAAO,YAAY,EAAE,EAAE;AAAA,EAAC,CAAE;AAAC;AAAC,uBAAuB,GAAE;AAAC,SAAO,KAAG,EAAE,WAAS,OAAO,EAAE,QAAQ,MAAM,GAAG,EAAE,EAAE;AAAC;AAAC,AAAW,CAAa,OAAO,WAApB,cAA4B,cAAY,QAAQ,OAAO,MAAlE,WAAqE,OAAO,UAAQ,SAAO,AAAY,OAAO,UAAnB,cAA2B,OAAO,MAAI,OAAO,CAAC,GAAG,WAAU;AAAC,SAAO;AAAM,CAAE,IAAE,OAAO,OAAK,OAAO,SAAO,OAAO,IAAI,OAAK,IAAI,IAAI,QAAO,OAAO,KAAK;;;ACAl3C,IAAO,oBAAQ;",
"names": []
}
......@@ -16,6 +16,7 @@ import {
watch,
watchEffect
} from "./chunk-BPFSQ7MV.js";
import "./chunk-76J2PTFD.js";
// node_modules/@vue/devtools-api/lib/esm/env.js
function getDevtoolsGlobalHook() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -145,6 +145,7 @@ import {
withModifiers,
withScopeId
} from "./chunk-BPFSQ7MV.js";
import "./chunk-76J2PTFD.js";
export {
BaseTransition,
Comment,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment