Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Feeding_Inc
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
m3-shakeel
Feeding_Inc
Commits
674bb6fe
Commit
674bb6fe
authored
2 years ago
by
charclayt
Browse files
Options
Downloads
Patches
Plain Diff
Added error messages for invalid login
parent
b95dc0ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/login.html
+1
-0
1 addition, 0 deletions
src/login.html
src/login.js
+2
-3
2 additions, 3 deletions
src/login.js
with
3 additions
and
3 deletions
src/login.html
+
1
−
0
View file @
674bb6fe
...
...
@@ -32,6 +32,7 @@
<label
for=
"loginPassword"
class=
"mb-1"
>
Password
</label>
<input
class=
"form-control mb-4"
id=
"loginPassword"
type=
"password"
placeholder=
"Password"
name=
"password"
>
</div>
<label
for=
"invalid-login"
id=
"invalid-login"
class=
"text-center w-100 pb-2"
style=
"color: red;"
></label>
<button
type=
"submit"
class=
"btn btn-outline-dark mx-auto d-block py-2"
id=
"submitLogin"
>
Login
</button>
</form>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/login.js
+
2
−
3
View file @
674bb6fe
...
...
@@ -43,16 +43,15 @@ function loginUser(username, password) {
resolve
(
user
);
}
else
{
alert
(
'
I
nvalid
Username or Password
'
)
;
document
.
getElementById
(
'
i
nvalid
-login
'
).
innerHTML
=
'
Invalid login credentials!
'
;
reject
(
new
Error
(
'
Inavlid username or Password
'
));
}
}
else
{
alert
(
'
I
nvalid
Username or Password
'
)
;
document
.
getElementById
(
'
i
nvalid
-login
'
).
innerHTML
=
'
Invalid login credentials!
'
;
reject
(
new
Error
(
'
Invalid username or Password
'
));
}
}
catch
(
err
)
{
console
.
error
(
err
);
alert
(
err
);
reject
(
err
);
}
})
...
...
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