0
AngularJSの新機能で、 "多すぎる自動リダイレクトが試みられました。アプリケーション側とAngularJSをサーバー側で実行していますが、C#私はC#サーバー側を作成していないので、間違いを探す場所を知りませんでした。私が探している特定のものがありますか?このエラーが表示される原因は何ですか?サーバー側またはクライアント側?多くのリダイレクトに返すAngularjs関数
var forgotPassword = ForgotPassword.save({email:resp}).$promise.then(
function Success(sucresp) {
console.log("This returned with: " + sucresp)
if (sucresp.ForgotPasswordResult.IsSuccess == true) {
$ionicPopup.alert({
title: "Password Changed",
template: sucresp.ForgotPasswordResult.ErrorMessage
});
} else {
$ionicPopup.alert({
title: "Password Was Not Changed",
template: sucresp.ForgotPasswordResult.ErrorMessage
});
}
},
function Failed(erresp){
console.log("This failed like your life, now start crying: " + erresp)
$ionicPopup.alert({
title: "Error Messge",
template: erresp
});
}
);
とサーバ側である。
public ForgotPasswordResponse ForgotPassword(string email)
{
ForgotPasswordResponse resp = new ForgotPasswordResponse();
resp.IsSuccess = false;
string emailAddress = email;
System.Security.Cryptography.RandomNumberGenerator randGen = System.Security.Cryptography.RandomNumberGenerator.Create();
byte[] bytes = new byte[6];
randGen.GetNonZeroBytes(bytes);
string newPassword = Convert.ToBase64String(bytes);
newPassword = Regex.Replace(newPassword, "[^a-zA-Z0-9]+", "", RegexOptions.Compiled);
bool resetPasswordResult = false;
try
{
string emailBody = string.Format(@"Your ****.com password has been reset.
The new password is {0}
Go to https://****.com/Login/login.aspx to login to the web site.
It is recommended that you change your password as soon as possible.
This message was sent from an automated system. Please do not reply to it.", newPassword);
Email.SendAmazonSES(emailAddress, "password reset", emailBody);
resetPasswordResult = ResetPassword(emailAddress, newPassword);
if (resetPasswordResult == false)
{
throw new Exception("The user account does not exist.");
}
resp.IsSuccess = true;
resp.ErrorMessage = "Your password has been reset. Check your email for the new password.";
}
catch (Exception ex)
{
resp.IsSuccess = false;
resp.ErrorMessage = ex.Message;
return resp;
}
return resp;
}
この機能は何をしますか?いくつかのコードがありますか? – devqon
Angular側かC#側について話していますか? –
両方、その原因となる可能性があります。 [this](http://stackoverflow.com/a/26660770/3153169) – devqon