Skip to content
Snippets Groups Projects
Commit 5546a554 authored by raghosh's avatar raghosh
Browse files

Merge branch 'menu_font' of git.mpi-cbg.de:dd-code-team/dd-code-web into menu_font

parents d756ee10 4d7f42ad
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,9 @@
mb-3
"
>
<div class="text-right px-8 w-full">Last updated: 30-06-2022</div>
<div class="text-right px-8 w-full">
Last updated: 30-06-2022
</div>
<div class="px-4 flex mb-2 flex-wrap w-full items-center justify-between">
<div class="ml-4">
<a href="/">
......@@ -20,7 +22,7 @@
alt="logo"
class="w-36 object-contain rounded-lg"
src="@/assets/cd-code-logo.png"
/>
>
</a>
</div>
<div class="flex items-center space-x-4">
......@@ -41,8 +43,7 @@
font-semibold
hover:text-pink-base
"
>Home</span
>
>Home</span>
</router-link>
<router-link
......@@ -61,8 +62,7 @@
text-4xl
font-semibold
"
>About</span
>
>About</span>
</router-link>
<router-link
......@@ -82,8 +82,7 @@
font-semibold
leading-snug
"
>Proteins</span
>
>Proteins</span>
</router-link>
<div class="relative rounded-lg">
<router-link
......@@ -109,8 +108,7 @@
font-semibold
leading-snug
"
>Condensates</span
>
>Condensates</span>
</router-link>
<div
v-if="openCondensateSubMenu"
......@@ -129,7 +127,10 @@
@mouseleave="openCondensateSubMenu = false"
>
<div>
<router-link to="/biomolecular" class="rounded-lg">
<router-link
to="/biomolecular"
class="rounded-lg"
>
<span
class="
px-4
......@@ -146,12 +147,14 @@
$route.name === 'biomolecular' ? 'text-pink-base' : ''
"
>
Biomolecular Condensates</span
>
Biomolecular Condensates</span>
</router-link>
</div>
<div>
<router-link to="/synthetic" class="rounded-lg">
<router-link
to="/synthetic"
class="rounded-lg"
>
<span
class="
px-4
......@@ -164,8 +167,7 @@
font-semibold
"
:class="$route.name === 'synthetic' ? 'text-pink-base' : ''"
>Synthetic Condensates</span
>
>Synthetic Condensates</span>
</router-link>
</div>
......@@ -174,7 +176,7 @@
<router-link
v-if="
userRole !== null &&
(userRole === 'Maintainer' || userRole === 'Contributor')
(userRole === 'Maintainer' || userRole === 'Contributor')
"
to="/addCondensate"
class="rounded-lg"
......@@ -194,8 +196,7 @@
:class="
$route.name === 'addCondensate' ? 'text-pink-base' : ''
"
>Add New Condensate</span
>
>Add New Condensate</span>
</router-link>
</div>
</div>
......@@ -217,8 +218,7 @@
text-4xl
font-semibold
"
>Statistics</span
>
>Statistics</span>
</router-link>
<a
......@@ -237,8 +237,7 @@
text-4xl
font-semibold
"
>Encyclopedia</span
>
>Encyclopedia</span>
</a>
<router-link
......@@ -257,8 +256,7 @@
text-4xl
font-semibold
"
>Help</span
>
>Help</span>
</router-link>
</div>
......@@ -284,8 +282,7 @@
text-3xl
font-medium
"
>Sign in</span
>
>Sign in</span>
</router-link>
<router-link
v-if="userData === null"
......@@ -307,8 +304,7 @@
text-3xl
font-medium
"
>Sign up</span
>
>Sign up</span>
</router-link>
</div>
......@@ -420,15 +416,14 @@
text-2xl
font-medium
"
>Profile</span
>
>Profile</span>
</router-link>
</div>
<div>
<router-link
v-show="
userData !== null &&
(userRole === 'Contributor' || userRole === 'Maintainer')
(userRole === 'Contributor' || userRole === 'Maintainer')
"
to="/updateItems"
role="presentation"
......@@ -475,8 +470,7 @@
text-2xl
font-medium
"
>All Submitted Condensates</span
>
>All Submitted Condensates</span>
</router-link>
</div>
<div>
......@@ -499,8 +493,7 @@
text-2xl
font-medium
"
>Logout</span
>
>Logout</span>
</router-link>
</div>
</div>
......@@ -521,7 +514,7 @@ export default {
},
computed: {
userData: function () {
return this.$store.getters["User/userData"];
return this.$store.getters['User/userData'];
},
userName() {
const data = this.parsingUserData();
......@@ -537,7 +530,7 @@ export default {
return initials;
},
userRole: function () {
return this.$store.getters["User/userRole"];
return this.$store.getters['User/userRole'];
},
},
mounted: function () {
......@@ -551,12 +544,12 @@ export default {
},
methods: {
parsingUserData() {
const data = this.$store.getters["User/userData"];
const data = this.$store.getters['User/userData'];
let parsedData = JSON.parse(data);
return parsedData;
},
getInitials(string) {
var names = string.split(" "),
var names = string.split(' '),
initials = names[0].substring(0, 1).toUpperCase();
if (names.length > 1) {
......@@ -572,11 +565,11 @@ export default {
},
signOut() {
const vm = this;
window.localStorage.removeItem("jwt");
window.localStorage.removeItem("userData");
window.localStorage.removeItem("roleName");
vm.$store.dispatch("User/logOut");
vm.$router.push("/login");
window.localStorage.removeItem('jwt');
window.localStorage.removeItem('userData');
window.localStorage.removeItem('roleName');
vm.$store.dispatch('User/logOut');
vm.$router.push('/login');
},
},
};
......
<template>
<div>
<base-toaster :open="toasterIsOpen" @close="hideDialog">
<base-toaster
:open="toasterIsOpen"
@close="hideDialog"
>
<div class="flex justify-between space-x-4 items-center">
<font-awesome-icon
class="ml-3"
......@@ -9,8 +12,14 @@
/>
<h4>Password reset link has been sent to {{ email.val }}.</h4>
<button class="btn btn-outline" @click="hideDialog">
<font-awesome-icon icon="fa-regular fa-circle-xmark" size="2x" />
<button
class="btn btn-outline"
@click="hideDialog"
>
<font-awesome-icon
icon="fa-regular fa-circle-xmark"
size="2x"
/>
</button>
</div>
</base-toaster>
......@@ -80,11 +89,17 @@
"
placeholder="Enter email address."
@blur="clearValidity('email')"
/>
<p v-if="!email.isValid" class="text-red-500 mt-2">
>
<p
v-if="!email.isValid"
class="text-red-500 mt-2"
>
Email must not be empty.
</p>
<p v-show="error" class="mt-2 text-red-500">
<p
v-show="error"
class="mt-2 text-red-500"
>
{{ errorMsg }}
</p>
</div>
......@@ -111,27 +126,27 @@
</div>
</template>
<script>
import BaseSpinner from "../components/UI/BaseSpinner.vue";
import BaseToaster from "../components/UI/BaseToaster.vue";
let host = require("@/components/js/const").apiHost;
import BaseSpinner from '../components/UI/BaseSpinner.vue';
import BaseToaster from '../components/UI/BaseToaster.vue';
let host = require('@/components/js/const').apiHost;
export default {
name: "ForgotPassword",
name: 'ForgotPassword',
components: { BaseSpinner, BaseToaster },
data() {
return {
email: {
val: "",
val: '',
isValid: true,
},
formIsValid: true,
done: false,
error: false,
isDev: process.env.NODE_ENV === "development",
isDev: process.env.NODE_ENV === 'development',
isLoading: false,
toasterIsOpen: false,
errorMsg: "",
errorMsg: '',
};
},
methods: {
......@@ -140,14 +155,14 @@ export default {
},
hideDialog() {
this.toasterIsOpen = false;
this.$router.push("login");
this.$router.push('login');
},
clearValidity(input) {
this[input].isValid = true;
},
validateForm() {
this.formIsValid = true;
if (this.email.val === "") {
if (this.email.val === '') {
this.email.isValid = false;
this.formIsValid = false;
}
......@@ -163,7 +178,7 @@ export default {
}
if (vm.isDev) {
host = require("@/components/js/const").devApiHost;
host = require('@/components/js/const').devApiHost;
}
this.isLoading = true;
this.done = false;
......@@ -173,11 +188,11 @@ export default {
// })
try {
const res = await fetch(`${host}/api/auth/forgot-password`, {
method: "POST",
mode: "cors", // no-cors, *cors, same-origin
cache: "no-cache", // *default, no-cache, reload, force-cache,
method: 'POST',
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache,
headers: {
"Content-Type": "application/json",
'Content-Type': 'application/json',
// 'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify({
......@@ -210,12 +225,12 @@ export default {
if (
!res.ok &&
response.error.status === 400 &&
response.error.message === "This email does not exist"
response.error.message === 'This email does not exist'
) {
this.isLoading = false;
this.error = true;
this.errorMsg =
"Provided email address is not yet registered with any existing account (User has not signed up yet)";
'Provided email address is not yet registered with any existing account (User has not signed up yet)';
return;
}
......
......@@ -29,7 +29,10 @@
</h1>
<form @submit="login">
<div class="my-4" :class="{ invalid: !email.isValid }">
<div
class="my-4"
:class="{ invalid: !email.isValid }"
>
<h1
class="
text-left
......@@ -58,12 +61,18 @@
"
placeholder="Enter email."
@blur="clearValidity('email')"
/>
<p v-if="!email.isValid" class="text-red-500">
>
<p
v-if="!email.isValid"
class="text-red-500"
>
Email must not be empty.
</p>
</div>
<div class="my-4" :class="{ invalid: !password.isValid }">
<div
class="my-4"
:class="{ invalid: !password.isValid }"
>
<h1
class="
text-left
......@@ -93,12 +102,18 @@
"
placeholder="Enter password."
@blur="clearValidity('password')"
/>
<p v-if="!password.isValid" class="text-red-500">
>
<p
v-if="!password.isValid"
class="text-red-500"
>
Password must not be empty.
</p>
</div>
<p v-show="error" class="text-red-500">
<p
v-show="error"
class="text-red-500"
>
{{ errorMsg }}
</p>
<button
......@@ -140,37 +155,37 @@
</div>
</template>
<script>
let host = require("@/components/js/const").apiHost;
let host = require('@/components/js/const').apiHost;
export default {
name: "Login",
name: 'Login',
data() {
return {
email: {
val: "",
val: '',
isValid: true,
},
password: {
val: "",
val: '',
isValid: true,
},
formIsValid: true,
error: false,
errorMsg: ``,
isDev: process.env.NODE_ENV === "development",
isDev: process.env.NODE_ENV === 'development',
isLoading: false,
};
},
computed: {
userData: function () {
return this.$store.getters["User/userData"];
return this.$store.getters['User/userData'];
},
},
mounted: function () {
const vm = this;
if (vm.userData !== null) {
this.$router.push("/profile");
this.$router.push('/profile');
}
},
methods: {
......@@ -179,11 +194,11 @@ export default {
},
validateForm() {
this.formIsValid = true;
if (this.email.val === "") {
if (this.email.val === '') {
this.email.isValid = false;
this.formIsValid = false;
}
if (this.password.val === "") {
if (this.password.val === '') {
this.password.isValid = false;
this.formIsValid = false;
}
......@@ -197,17 +212,17 @@ export default {
return;
}
if (vm.isDev) {
host = require("@/components/js/const").devApiHost;
host = require('@/components/js/const').devApiHost;
}
console.log("url is", host);
console.log('url is', host);
this.isLoading = true;
try {
const res = await fetch(`${host}/api/auth/local`, {
method: "POST",
mode: "cors", // no-cors, *cors, same-origin
cache: "no-cache", // *default, no-cache, reload, force-cache,
method: 'POST',
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache,
headers: {
"Content-Type": "application/json",
'Content-Type': 'application/json',
// 'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify({
......@@ -243,27 +258,27 @@ export default {
if (
!res.ok &&
response.error.status === 400 &&
response.error.message === "Invalid identifier or password"
response.error.message === 'Invalid identifier or password'
) {
this.isLoading = false;
this.error = true;
this.errorMsg = "Email Address & Password mismatch.";
this.password.val = "";
this.errorMsg = 'Email Address & Password mismatch.';
this.password.val = '';
return;
}
const { jwt, user } = response;
window.localStorage.setItem("jwt", jwt);
window.localStorage.setItem("userData", JSON.stringify(user));
window.localStorage.setItem('jwt', jwt);
window.localStorage.setItem('userData', JSON.stringify(user));
this.$store.dispatch("User/setJwt", jwt);
this.$store.dispatch("User/setUserData", JSON.stringify(user));
this.$store.dispatch('User/setJwt', jwt);
this.$store.dispatch('User/setUserData', JSON.stringify(user));
this.isLoading = false;
this.error = false;
this.$router.push("/profile");
this.$router.push('/profile');
} catch (err) {
console.log("catch error", err);
console.log('catch error', err);
this.isLoading = false;
this.error = true;
this.errorMsg = `${err.message} Internal Error, please write a mail to CDCode Admin`;
......
<template>
<div class="mb-14">
<base-toaster :open="toasterIsOpen" @close="hideDialog">
<base-toaster
:open="toasterIsOpen"
@close="hideDialog"
>
<div class="flex justify-between space-x-4 items-center">
<font-awesome-icon
class="ml-3"
......@@ -14,8 +17,14 @@
. Please click the link to activate your account.
</h4>
<button class="btn btn-outline" @click="hideDialog">
<font-awesome-icon icon="fa-regular fa-circle-xmark" size="2x" />
<button
class="btn btn-outline"
@click="hideDialog"
>
<font-awesome-icon
icon="fa-regular fa-circle-xmark"
size="2x"
/>
</button>
</div>
</base-toaster>
......@@ -47,7 +56,10 @@
</h1>
<form @submit.prevent="register">
<div class="my-4" :class="{ invalid: !name.isValid }">
<div
class="my-4"
:class="{ invalid: !name.isValid }"
>
<div class="flex justify-between">
<h1
class="
......@@ -92,12 +104,18 @@
"
placeholder="Enter full name."
@blur="clearValidity('name')"
/>
<p v-if="!name.isValid" class="text-red-500">
>
<p
v-if="!name.isValid"
class="text-red-500"
>
Name must not be empty.
</p>
</div>
<div class="my-4" :class="{ invalid: !email.isValid }">
<div
class="my-4"
:class="{ invalid: !email.isValid }"
>
<h1
class="
text-left
......@@ -127,15 +145,24 @@
"
placeholder="Enter email."
@blur="clearValidity('email')"
/>
<p v-if="!email.isValid" class="text-red-500">
>
<p
v-if="!email.isValid"
class="text-red-500"
>
Email must not be empty.
</p>
<p v-if="error && errorMsg" class="text-red-500">
<p
v-if="error && errorMsg"
class="text-red-500"
>
{{ errorMsg }}
</p>
</div>
<div class="my-4" :class="{ invalid: !password.isValid }">
<div
class="my-4"
:class="{ invalid: !password.isValid }"
>
<h1
class="
text-left
......@@ -165,12 +192,18 @@
"
placeholder="Password must be minimum 6 character."
@blur="clearValidity('password')"
/>
<p v-if="!password.isValid" class="text-red-500">
>
<p
v-if="!password.isValid"
class="text-red-500"
>
Password must not be empty or less than 6 character.
</p>
</div>
<div class="my-4" :class="{ invalid: !username.isValid }">
<div
class="my-4"
:class="{ invalid: !username.isValid }"
>
<h1
class="
text-left
......@@ -201,12 +234,18 @@
"
placeholder="Username must be minimum 3 character."
@blur="clearValidity('username')"
/>
<p v-if="!username.isValid" class="text-red-500">
>
<p
v-if="!username.isValid"
class="text-red-500"
>
Username must not be empty.
</p>
</div>
<div class="my-4" :class="{ invalid: !current_role.isValid }">
<div
class="my-4"
:class="{ invalid: !current_role.isValid }"
>
<h1
class="
text-left
......@@ -238,9 +277,22 @@
"
@blur="clearValidity('current_role')"
>
<option id="phd" value="PhD">PhD</option>
<option id="postdoc" value="PostDoc">PostDoc</option>
<option id="research_scientist" value="Research_Scientist">
<option
id="phd"
value="PhD"
>
PhD
</option>
<option
id="postdoc"
value="PostDoc"
>
PostDoc
</option>
<option
id="research_scientist"
value="Research_Scientist"
>
Research Scientist
</option>
<option
......@@ -250,7 +302,10 @@
Principal Investigator
</option>
</select>
<p v-if="!current_role.isValid" class="text-red-500">
<p
v-if="!current_role.isValid"
class="text-red-500"
>
Select a current role.
</p>
</div>
......@@ -282,16 +337,25 @@
:name="options"
:value="options.discipline"
@blur="clearValidity('scientific_discipline')"
/>
<label class="mx-3" :for="options.id">{{
>
<label
class="mx-3"
:for="options.id"
>{{
options.discipline
}}</label>
</div>
<p v-if="!scientific_discipline.isValid" class="text-red-500">
<p
v-if="!scientific_discipline.isValid"
class="text-red-500"
>
Please select atleast one scientific discipline.
</p>
</div>
<div class="my-4" :class="{ invalid: !affiliation.isValid }">
<div
class="my-4"
:class="{ invalid: !affiliation.isValid }"
>
<h1
class="
text-left
......@@ -321,12 +385,18 @@
"
placeholder="Institute name currently associated with."
@blur="clearValidity('affiliation')"
/>
<p v-if="!affiliation.isValid" class="text-red-500">
>
<p
v-if="!affiliation.isValid"
class="text-red-500"
>
Affiliation must not be empty.
</p>
</div>
<div class="my-4" :class="{ invalid: !profileLink.isValid }">
<div
class="my-4"
:class="{ invalid: !profileLink.isValid }"
>
<h1
class="
text-left
......@@ -356,8 +426,11 @@
"
placeholder="eg- https://www.google.com (optional)"
@blur="clearValidity('profileLink')"
/>
<p v-if="!profileLink.isValid" class="text-red-500">
>
<p
v-if="!profileLink.isValid"
class="text-red-500"
>
The url entered is invalid. Please check it again!
</p>
<p
......@@ -367,7 +440,10 @@
{{ profileLinkErrMsg }}
</p>
</div>
<div class="my-4" :class="{ invalid: !motivation.isValid }">
<div
class="my-4"
:class="{ invalid: !motivation.isValid }"
>
<h1
class="
text-left
......@@ -400,13 +476,22 @@
@blur="clearValidity('motivation')"
/>
</div>
<p v-if="!motivation.isValid" class="text-red-500">
<p
v-if="!motivation.isValid"
class="text-red-500"
>
Motivation text must not be empty.
</p>
<p v-if="!formIsValid" class="font-bold text-red-400">
<p
v-if="!formIsValid"
class="font-bold text-red-400"
>
Required fields were not provided.
</p>
<p v-show="error" class="text-red-500">
<p
v-show="error"
class="text-red-500"
>
{{ errorMsg }}
</p>
<div v-if="isLoading">
......@@ -436,8 +521,7 @@
<a
class="text-pink-base hover:text-pink-base hover:no-underline"
@click="$router.go(-1)"
>Sign in</a
>
>Sign in</a>
</h4>
</div>
</form>
......@@ -447,45 +531,45 @@
</div>
</template>
<script>
import BaseSpinner from "../components/UI/BaseSpinner.vue";
import BaseToaster from "../components/UI/BaseToaster.vue";
let host = require("@/components/js/const").apiHost;
import BaseSpinner from '../components/UI/BaseSpinner.vue';
import BaseToaster from '../components/UI/BaseToaster.vue';
let host = require('@/components/js/const').apiHost;
export default {
name: "Register",
name: 'Register',
components: { BaseToaster, BaseSpinner },
data() {
return {
name: {
val: "",
val: '',
isValid: true,
},
email: {
val: "",
val: '',
isValid: true,
},
password: {
val: "",
val: '',
isValid: true,
},
username: {
val: "",
val: '',
isValid: true,
},
motivation: {
val: "",
val: '',
isValid: true,
},
affiliation: {
val: "",
val: '',
isValid: true,
},
current_role: {
val: "",
val: '',
isValid: true,
},
profileLink: {
val: "",
val: '',
isValid: true,
},
scientific_discipline: {
......@@ -495,17 +579,17 @@ export default {
formIsValid: true,
error: false,
errorMsg: ``,
isDev: process.env.NODE_ENV === "development",
isDev: process.env.NODE_ENV === 'development',
toasterIsOpen: false,
scientificDisciplineOptions: [
{ id: "1", discipline: "Physics" },
{ id: "2", discipline: "Chemistry" },
{ id: "3", discipline: "Biology" },
{ id: "4", discipline: "Computer Science" },
{ id: "5", discipline: "Mathematics" },
{ id: '1', discipline: 'Physics' },
{ id: '2', discipline: 'Chemistry' },
{ id: '3', discipline: 'Biology' },
{ id: '4', discipline: 'Computer Science' },
{ id: '5', discipline: 'Mathematics' },
],
profileLinkError: false,
profileLinkErrMsg: "",
profileLinkErrMsg: '',
selected: [],
isLoading: false,
};
......@@ -517,23 +601,23 @@ export default {
},
validateForm() {
this.formIsValid = true;
if (this.name.val === "") {
if (this.name.val === '') {
this.name.isValid = false;
this.formIsValid = false;
}
if (this.email.val === "") {
if (this.email.val === '') {
this.email.isValid = false;
this.formIsValid = false;
}
if (this.password.val === "" || this.password.val.length < 6) {
if (this.password.val === '' || this.password.val.length < 6) {
this.password.isValid = false;
this.formIsValid = false;
}
if (this.username.val === "" || this.username.val.length < 3) {
if (this.username.val === '' || this.username.val.length < 3) {
this.username.isValid = false;
this.formIsValid = false;
}
if (this.current_role.val === "") {
if (this.current_role.val === '') {
this.current_role.isValid = false;
this.formIsValid = false;
}
......@@ -541,7 +625,7 @@ export default {
this.scientific_discipline.isValid = false;
this.formIsValid = false;
}
if (this.affiliation.val === "") {
if (this.affiliation.val === '') {
this.affiliation.isValid = false;
this.formIsValid = false;
}
......@@ -549,7 +633,7 @@ export default {
this.profileLink.isValid = false;
this.formIsValid = false;
}
if (this.motivation.val === "") {
if (this.motivation.val === '') {
this.motivation.isValid = false;
this.formIsValid = false;
}
......@@ -557,21 +641,21 @@ export default {
isValidHttpUrl() {
let timer = null;
let pattern = new RegExp(
"^(https?:\\/\\/)?" + // protocol
"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name
"((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
"(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
"(\\#[-a-z\\d_]*)?$",
"i"
'^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$',
'i'
); // fragment locator
let isValid;
if (this.profileLink.val === "") {
console.log("profile link empty");
if (this.profileLink.val === '') {
console.log('profile link empty');
return true;
} else {
isValid = pattern.test(this.profileLink.val);
console.log("lint is there", isValid);
console.log('lint is there', isValid);
}
return isValid;
// if(!isValid){
......@@ -601,7 +685,7 @@ export default {
},
hideDialog() {
this.toasterIsOpen = false;
this.$router.push("login");
this.$router.push('login');
},
async register(e) {
const vm = this;
......@@ -612,15 +696,15 @@ export default {
}
if (vm.isDev) {
host = require("@/components/js/const").devApiHost;
host = require('@/components/js/const').devApiHost;
}
this.isLoading = true;
const res = await fetch(`${host}/api/auth/local/register`, {
method: "POST",
mode: "cors", // no-cors, *cors, same-origin
cache: "no-cache", // *default, no-cache, reload, force-cache,
method: 'POST',
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache,
headers: {
"Content-Type": "application/json",
'Content-Type': 'application/json',
// 'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify({
......@@ -653,19 +737,19 @@ export default {
if (
!res.ok &&
response.error.status === 400 &&
response.error.message === "Email is already taken"
response.error.message === 'Email is already taken'
) {
this.isLoading = false;
this.error = true;
this.errorMsg =
"Email Address already registered with an existing account. You can reset your password by clicking forget password from sign up page.";
this.password.val = "";
'Email Address already registered with an existing account. You can reset your password by clicking forget password from sign up page.';
this.password.val = '';
return;
}
this.isLoading = false;
vm.toasterIsOpen = true;
this.error = false;
this.errorMsg = "";
this.errorMsg = '';
// try {
// await vm.axios.post(`${host}/api/auth/local/register`, {
// full_name: vm.name.val,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment