add password validation plus some cleanup
This commit is contained in:
parent
591de12e69
commit
510a879b5e
@ -1,7 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
<div class="header-content">
|
<div class="header-content">
|
||||||
<img class="company-logo" alt="freeleaps logo" src="@/assets/freeleaps.png" />
|
<img
|
||||||
|
class="company-logo"
|
||||||
|
alt="freeleaps logo"
|
||||||
|
src="@/assets/freeleaps.png"
|
||||||
|
@click="gotoFrontdoor()"
|
||||||
|
/>
|
||||||
<!-- <div class="content-area">
|
<!-- <div class="content-area">
|
||||||
<span class="company-slogan"
|
<span class="company-slogan"
|
||||||
>Freeleaps: A trustworthy platform to find a software development partner</span
|
>Freeleaps: A trustworthy platform to find a software development partner</span
|
||||||
@ -22,6 +27,9 @@ export default {
|
|||||||
components: {},
|
components: {},
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
|
gotoFrontdoor() {
|
||||||
|
this.mnx_navToFrontDoor()
|
||||||
|
},
|
||||||
gotoAbout() {
|
gotoAbout() {
|
||||||
this.mnx_navToAbout()
|
this.mnx_navToAbout()
|
||||||
},
|
},
|
||||||
@ -57,6 +65,7 @@ export default {
|
|||||||
|
|
||||||
.company-logo {
|
.company-logo {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.company-slogan {
|
.company-slogan {
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { UserAuthApi } from '../../utils/index'
|
import { UserAuthApi, passwordValidator } from '../../utils/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'NewUserSetPassword',
|
name: 'NewUserSetPassword',
|
||||||
props: {},
|
props: {},
|
||||||
@ -67,7 +67,7 @@ export default {
|
|||||||
this.message = 'The two passwords are not matched'
|
this.message = 'The two passwords are not matched'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.message = passwordValidator.validate(this.password)
|
||||||
if (this.message != null) return
|
if (this.message != null) return
|
||||||
|
|
||||||
UserAuthApi.updatePassword(this.password, this.password2)
|
UserAuthApi.updatePassword(this.password, this.password2)
|
||||||
|
|||||||
@ -762,7 +762,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import { moneyCollectionTypeEnum } from '../../../types/index'
|
import { moneyCollectionTypeEnum } from '../../../types/index'
|
||||||
|
|
||||||
import { UserProfileApi, elementHandler, textAreaAujuster } from '../../../utils/index'
|
import {
|
||||||
|
UserProfileApi,
|
||||||
|
elementHandler,
|
||||||
|
textAreaAujuster,
|
||||||
|
passwordValidator
|
||||||
|
} from '../../../utils/index'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UserProfile',
|
name: 'UserProfile',
|
||||||
@ -984,7 +989,10 @@ export default {
|
|||||||
} else if (!this.passwordOperation.password) {
|
} else if (!this.passwordOperation.password) {
|
||||||
//Do nothing since there is no password input
|
//Do nothing since there is no password input
|
||||||
} else {
|
} else {
|
||||||
this.updatePassword(this.passwordOperation.password, this.passwordOperation.password2)
|
this.passwordOperation.message = passwordValidator.validate(this.passwordOperation.password)
|
||||||
|
if (!this.passwordOperation.password) {
|
||||||
|
this.updatePassword(this.passwordOperation.password, this.passwordOperation.password2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -386,7 +386,6 @@ const router = createRouter({
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach(function (to, from, next) {
|
router.beforeEach(function (to, from, next) {
|
||||||
console.log('beforeEach', to)
|
|
||||||
if (to.name == 'front-door') {
|
if (to.name == 'front-door') {
|
||||||
next()
|
next()
|
||||||
} else if (to.meta.requiredRoles.includes(userRoleEnum.NONE)) {
|
} else if (to.meta.requiredRoles.includes(userRoleEnum.NONE)) {
|
||||||
|
|||||||
@ -14,6 +14,6 @@ export { userUtils, userProfileUtils, requestIssueUtils, requestHubUtils } from
|
|||||||
|
|
||||||
export { ValueChecker, DateUtils, OIDUtils } from './common/index'
|
export { ValueChecker, DateUtils, OIDUtils } from './common/index'
|
||||||
|
|
||||||
export { userProfileValidator } from './validator/index'
|
export { passwordValidator } from './validator/index'
|
||||||
|
|
||||||
export { textAreaAujuster, tooltip, elementHandler, mediaDataHandler } from './html/index'
|
export { textAreaAujuster, tooltip, elementHandler, mediaDataHandler } from './html/index'
|
||||||
|
|||||||
@ -1,8 +1 @@
|
|||||||
export { userProfileValidator } from './userProfile'
|
export { passwordValidator } from './passwordValidator'
|
||||||
export { businessProfileValidator } from './businessProfile'
|
|
||||||
export { problemValidator } from './problemValidator'
|
|
||||||
export { codingInterviewValidator } from './codingInterviewValidator'
|
|
||||||
export { jobPositionValidator } from './jobPositionValidator'
|
|
||||||
export { applicantValidator } from './applicantValidator'
|
|
||||||
export { solutionSubmissionValidator } from './solutionSubmissionValidator'
|
|
||||||
export { uploadFileLengthValidator } from './uploadFileLengthValidator'
|
|
||||||
|
|||||||
@ -22,5 +22,5 @@ class PasswordValidator extends TextValidator {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const passwordValidator = new PasswordValidator()
|
||||||
export { PasswordValidator }
|
export { passwordValidator }
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
import { UsernameValidator } from './usernameValidator'
|
|
||||||
import { PasswordValidator } from './passwordValidator'
|
|
||||||
import { NameValidator } from './nameValidator'
|
|
||||||
import { MobileValidator } from './mobileValidator'
|
|
||||||
import { EmailValidator } from './emailValidator'
|
|
||||||
import { ImageValidator } from './imageValidator'
|
|
||||||
import { AuthCodeValidator } from './authCodeValidator'
|
|
||||||
import { CountryNameValidator } from './countryNameValidator'
|
|
||||||
import { FilenameValidator } from './filenameValidator'
|
|
||||||
import { TextFileValidator } from './textFileValidator'
|
|
||||||
|
|
||||||
class ProfileValidator {
|
|
||||||
constructor() {
|
|
||||||
this.usernameValidator = new UsernameValidator()
|
|
||||||
this.passwordValidator = new PasswordValidator()
|
|
||||||
this.nameValidator = new NameValidator()
|
|
||||||
this.mobileValidator = new MobileValidator()
|
|
||||||
this.emailValidator = new EmailValidator()
|
|
||||||
this.imageValidator = new ImageValidator()
|
|
||||||
this.authCodeValidator = new AuthCodeValidator()
|
|
||||||
this.countryNameValidator = new CountryNameValidator()
|
|
||||||
this.resumenameValidator = new FilenameValidator()
|
|
||||||
this.resumeFileValidator = new TextFileValidator()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const userProfileValidator = new ProfileValidator()
|
|
||||||
|
|
||||||
export { userProfileValidator }
|
|
||||||
@ -38,7 +38,7 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'^/api/': {
|
'^/api/': {
|
||||||
target: 'https://localhost:8001/',
|
target: 'http://localhost:8001/',
|
||||||
ws: true,
|
ws: true,
|
||||||
changeOrigin: true
|
changeOrigin: true
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user