TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Beshoy Wageh
NA
33
4.6k
This Code not check of email in database
Jan 17 2019 2:07 PM
public ActionResult Login(Log login, string ReturnUrl = "")
{
string message = "";
using (LoginContext dc = new LoginContext())
{
var v = dc.registers.Where(a => a.Email == login.EmailID).FirstOrDefault();
if (v != null)
{
#region Verify Password
if (!v.IsEmailVerified)
{
ViewBag.Message = "Please verify your email first";
return View();
}
#endregion
#region Verify Password
if (string.Compare(Crypto.Hash(login.Password), v.Password) == 0)
{
int timeout = login.RememberMe ? 525600 : 20; // 525600 min = 1 year
var ticket = new FormsAuthenticationTicket(login.EmailID, login.RememberMe, timeout);
string encrypted = FormsAuthentication.Encrypt(ticket);
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encrypted);
cookie.Expires = DateTime.Now.AddMinutes(timeout);
cookie.HttpOnly = true;
Response.Cookies.Add(cookie);
if (Url.IsLocalUrl(ReturnUrl))
{
return Redirect(ReturnUrl);
}
else
{
return RedirectToAction("Index", "Home");
}
}
else
{
message = " You Need To Register Now !!! ";
}
#endregion
}
else
{
message = " You Need To Register Now !!! ";
}
}
ViewBag.Message = message;
return View();
}
Reply
Answers (
2
)
The build task could not find node.exe which is required to
Get Dot net specific code for following java program