Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IDATT2106 - Gruppe 2
idatt2106_2024_02_frontend
Commits
23967999
Commit
23967999
authored
11 months ago
by
Trygve Jørgensen
Browse files
Options
Downloads
Patches
Plain Diff
fix: register regex updated
parent
b1c5eb76
No related branches found
Branches containing commit
No related tags found
3 merge requests
!66
Final merge
,
!31
Updated input validation
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/FormRegister.vue
+9
-8
9 additions, 8 deletions
src/components/FormRegister.vue
with
9 additions
and
8 deletions
src/components/FormRegister.vue
+
9
−
8
View file @
23967999
...
@@ -15,10 +15,11 @@ const errorMessage = ref<string>('')
...
@@ -15,10 +15,11 @@ const errorMessage = ref<string>('')
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
nameRegex
=
/^
[
a-zA-Z ,.'-
]
+$/
const
nameRegex
=
/^
[
æÆøØåÅa-zA-Z,.'-
][
æÆøØåÅa-zA-Z ,.'-
]{1,29}
$/
const
emailRegex
=
/^
[
a-zA-Z0-9_+&*-
]
+
(?:\.[
a-zA-Z0-9_+&*-
]
+
)
*@
(?:[
a-zA-Z0-9-
]
+
\.)
+
[
a-zA-Z
]{2,7}
$/
const
emailRegex
=
const
usernameRegex
=
/^
[
A-Za-z
][
A-Za-z0-9_
]{2,29}
$/
/^
[
æÆøØåÅa-zA-Z0-9_+&*-
]
+
(?:\.[
æÆøØåÅa-zA-Z0-9_+&*-
]
+
)
*@
(?:[
æÆøØåÅa-zA-Z0-9-
]
+
\.)
+
[
æÆøØåÅa-zA-Z
]{2,7}
$/
const
passwordRegex
=
/^
(?=
.*
[
0-9
])(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[
@#$%^&+=!
])(?=\S
+$
)
.
{8,}
$/
const
usernameRegex
=
/^
[
ÆØÅæøåA-Za-z
][
æÆøØåÅA-Za-z0-9_
]{2,29}
$/
const
passwordRegex
=
/^
(?=
.*
[
0-9
])(?=
.*
[
a-zæøå
])(?=
.*
[
ÆØÅA-Z
])(?=
.*
[
@#$%^&+=!
])(?=\S
+$
)
.
{8,30}
$/
const
isFirstNameValid
=
computed
(()
=>
nameRegex
.
test
(
firstname
.
value
)
&&
firstname
.
value
)
const
isFirstNameValid
=
computed
(()
=>
nameRegex
.
test
(
firstname
.
value
)
&&
firstname
.
value
)
const
isLastNameValid
=
computed
(()
=>
nameRegex
.
test
(
lastname
.
value
)
&&
lastname
.
value
)
const
isLastNameValid
=
computed
(()
=>
nameRegex
.
test
(
lastname
.
value
)
&&
lastname
.
value
)
...
@@ -55,7 +56,7 @@ watch(
...
@@ -55,7 +56,7 @@ watch(
<div
class=
"flex flex-row justify-between mx-4"
>
<div
class=
"flex flex-row justify-between mx-4"
>
<p>
Fornavn*
</p>
<p>
Fornavn*
</p>
<ToolTip
<ToolTip
:message=
"'Must include only letters, spaces, commas, apostrophes, periods, and hyphens.'"
:message=
"'Must include only letters, spaces, commas, apostrophes, periods, and hyphens.
1-30 characters long
'"
/>
/>
</div>
</div>
<input
<input
...
@@ -70,7 +71,7 @@ watch(
...
@@ -70,7 +71,7 @@ watch(
<div
class=
"flex flex-row justify-between mx-4"
>
<div
class=
"flex flex-row justify-between mx-4"
>
<p>
Etternavn*
</p>
<p>
Etternavn*
</p>
<ToolTip
<ToolTip
:message=
"'Must include only letters, spaces, commas, apostrophes, periods, and hyphens.'"
:message=
"'Must include only letters, spaces, commas, apostrophes, periods, and hyphens.
1-30 characters long
'"
/>
/>
</div>
</div>
<input
<input
...
@@ -85,7 +86,7 @@ watch(
...
@@ -85,7 +86,7 @@ watch(
<div
class=
"flex flex-row justify-between mx-4"
>
<div
class=
"flex flex-row justify-between mx-4"
>
<p>
E-post*
</p>
<p>
E-post*
</p>
<ToolTip
<ToolTip
:message=
"'
Must include a valid format with \'@\' and a domain, only
letters, numbers,
and
special characters
(_ + & * -) allowed
.'"
:message=
"'
Valid email: Starts with Norwegian
letters, numbers,
or
special characters
. Includes \@\ followed by a domain. Ends with 2-7 letters
.'"
/>
/>
</div>
</div>
<input
<input
...
@@ -100,7 +101,7 @@ watch(
...
@@ -100,7 +101,7 @@ watch(
<div
class=
"flex flex-row justify-between mx-4"
>
<div
class=
"flex flex-row justify-between mx-4"
>
<p>
Brukernavn*
</p>
<p>
Brukernavn*
</p>
<ToolTip
<ToolTip
:message=
"'Must start with a letter and can include numbers and underscores
,
3-30 characters long.'"
:message=
"'Must start with a letter and can include numbers and underscores
.
3-30 characters long.'"
/>
/>
</div>
</div>
<input
<input
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment