-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
authored and
unknown
committed
Nov 28, 2014
1 parent
a54237a
commit 1dfc2ed
Showing
4 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,6 +381,7 @@ public HttpResponseMessage PatchUser(int id, Delta<User> user) | |
//// POST api/User | ||
[ResponseType(typeof(User))] | ||
[FsdtsExceptionHandler] | ||
[HttpPost] | ||
public IHttpActionResult PostUser(User user) | ||
{ | ||
if (!ModelState.IsValid) | ||
|
@@ -459,11 +460,8 @@ private bool UserExists(int id) | |
|
||
[ResponseType(typeof(User))] | ||
[FsdtsExceptionHandler] | ||
<<<<<<< Updated upstream | ||
======= | ||
[Route("Api/Login")] | ||
[HttpPost] | ||
[HttpPost] | ||
public HttpResponseMessage Login(User userobj) | ||
{ | ||
HttpResponse response = HttpContext.Current.Response; | ||
|
@@ -495,16 +493,27 @@ public HttpResponseMessage Login(User userobj) | |
return null; | ||
} | ||
|
||
public HttpResponseMessage PostForgotPassword(string userEmailId, string userFirstName) | ||
[Route("api/ForgotPassword")] | ||
public HttpResponseMessage ForgotPassword(User userObj) | ||
{ | ||
User user = db.User.SingleOrDefault(usr => usr.UserEmail == userEmailId && usr.UserFirstName == userFirstName); | ||
HttpResponse response = HttpContext.Current.Response;; // = new HttpResponse(); | ||
User user = db.User.SingleOrDefault(usr => usr.UserEmail == userObj.UserEmail && usr.UserFirstName == userObj.UserFirstName); | ||
HttpResponse response = HttpContext.Current.Response; | ||
if (user != null) | ||
{ | ||
response.Write("Success"); | ||
string uniqueCode = UserBO.GetUniqueKey(user); | ||
string url = Convert.ToString(ConfigurationManager.AppSettings.Get("ForgotPasswordLink")); | ||
// FsdtsCommonMethods.SendEmail("[email protected]", "test mail", FsdtsConstants.MailBody + uniqueCode); | ||
if (user.VerificationNo == userObj.VerificationNo) | ||
{ | ||
string uniqueCode = UserBO.GetUniqueKey(user); | ||
response.Write("Success"); | ||
url += uniqueCode; | ||
FsdtsCommonMethods.SendEmail(user.UserEmail, "test mail", url); | ||
user.VerificationNo = uniqueCode; | ||
db.SaveChanges(); | ||
} | ||
else | ||
{ | ||
response.Write("Invalid request"); | ||
} | ||
} | ||
else | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters