add login page
This commit is contained in:
1 parent
343c0e3f44
commit
d5bbae42c5
5 files changed
+93
-6
No files matched your search
@@ -141,7 +141,12 @@ func Login(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
var user models.User
|
||||
err := userCollection.FindOne(ctx, bson.M{"username": username}).Decode(&user)
|
||||
err := userCollection.FindOne(ctx, bson.M{
|
||||
"$or": []bson.M{
|
||||
{"email": username},
|
||||
{"username": username},
|
||||
},
|
||||
}).Decode(&user)
|
||||
defer cancel()
|
||||
|
||||
if err != nil {
|
||||
@@ -166,7 +171,12 @@ func Login(c *fiber.Ctx) error {
|
||||
|
||||
_, updateErr := userCollection.UpdateOne(
|
||||
ctx,
|
||||
bson.M{"username": username},
|
||||
bson.M{
|
||||
"$or": []bson.M{
|
||||
{"email": username},
|
||||
{"username": username},
|
||||
},
|
||||
},
|
||||
update,
|
||||
)
|
||||
if updateErr != nil {
|
||||
|
||||
@@ -54,8 +54,11 @@ func DashboardPage(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
return c.Status(fiber.StatusAccepted).Render("dashboard", fiber.Map{
|
||||
"msg": "",
|
||||
"errorMsg": "",
|
||||
"user": user,
|
||||
"msg": "",
|
||||
"errorMsg": "",
|
||||
"username": user.Username,
|
||||
"email": user.Email,
|
||||
"firstname": user.Firstname,
|
||||
"lastname": user.Lastname,
|
||||
})
|
||||
}
|
||||
@@ -47,6 +47,9 @@ h1, h2, h3, h4, h5, h6{
|
||||
font-weight: 400;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
#signup:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
.text{
|
||||
margin: 0.6rem 0;
|
||||
opacity: 0.8;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@
|
||||
|
||||
<div class="hero-div center container">
|
||||
<h1>BugBeGone, Bug Tracking Software</h1>
|
||||
<p class="animate__animated animate__fadeInUp animate__slow">The best way to track, and solve bugs as a team.</p>
|
||||
<p class="animate__animated animate__fadeInUp animate__slow">The best way to track and solve bugs as a team.</p>
|
||||
|
||||
<div class="hero-btns animate__animated animate__fadeInUp animate__slow">
|
||||
<a href="https://discord.gg/9ZdkyRmxCH"><button type="button" class="btn-trans">Join our Discord</button></a>
|
||||
|
||||
@@ -4,8 +4,79 @@
|
||||
<title>Login - BugBeGone</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="static/styles/register.css">
|
||||
<script src="https://kit.fontawesome.com/ccff26c93b.js" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<nav class="navbar">
|
||||
<div class="container2">
|
||||
<div class="brand-and-toggler">
|
||||
<a href="/" class="navbar-brand">
|
||||
BugBeGone
|
||||
</a>
|
||||
<button type="button" class="navbar-toggler" id="navbar-toggler">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="navbar-collapse">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a href="/#info" class="nav-link">info</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/#feature" class="nav-link">feature</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/#team" class="nav-link">team</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/#pricing" class="nav-link">pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/#contact" class="nav-link">contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/register" class="nav-link">sign up</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="center">
|
||||
<h1>Login</h1>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="navigation">
|
||||
<ol>
|
||||
<li><a href="#" data-ref="username">Username</a></li>
|
||||
<li><a href="#" data-ref="viewpswd">Password</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
<form id="sign-form" class="sign-form" action="/login" method="POST">
|
||||
<ol class="questions">
|
||||
<li>
|
||||
<span><label for="username">Welcome Back, enter your Username or Email</label></span>
|
||||
<input class="active" id="username" name="username" type="text" placeholder="Username or Email" autofocus/>
|
||||
</li>
|
||||
<li>
|
||||
<span><label for="password">Enter your password?</label></span>
|
||||
<input id="viewpswd" name="password" type="text" placeholder="this your password"/>
|
||||
<input id="password" name="password" type="password" placeholder="Password" autofocus/>
|
||||
<span id="show-pwd" class="view"></span>
|
||||
</li>
|
||||
<li><p style="margin-top: 45px;font-size: 32pt;float:right">
|
||||
<a ref="javascript:{}" onclick="document.getElementById('sign-form').submit();" style="color:white;text-decoration:none" id="signup">Login</a></p>
|
||||
</li>
|
||||
</ol>
|
||||
<div id="next-page" alt="Kiwi standing on oval"></div>
|
||||
<div class="error-message">{{ .errorMsg }}</div>
|
||||
</form>
|
||||
<h1 id="wf" style="opacity:0;width: 600px; margin-top:1.1em;display:none; margin-bottom:1em">One moment...</h1>
|
||||
</body>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="static/scripts/register.js"></script>
|
||||
</html>
|
||||
Reference in new issue
Block a user