Disabled simple login for BitID-enabled accounts
This commit is contained in:
+10
-1
@@ -19,7 +19,7 @@ namespace Resources.Pages {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option or rebuild the Visual Studio project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Security {
|
||||
@@ -250,6 +250,15 @@ namespace Resources.Pages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <strong>BITID LOGIN REQUIRED</strong><br/><br/>This login requires BitId authentication, as enabled by the account holder. You cannot log on with a username/password combination..
|
||||
/// </summary>
|
||||
internal static string Login_BitIdRequired_Dialog {
|
||||
get {
|
||||
return ResourceManager.GetString("Login_BitIdRequired_Dialog", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 2FA.
|
||||
/// </summary>
|
||||
|
||||
@@ -182,6 +182,9 @@
|
||||
<data name="Login_BitIdEnabled" xml:space="preserve">
|
||||
<value><strong>BitId two-factor authentication is now enabled.</strong><br/><br/>From now on, you can use your bitcoin wallet to log in (and will <strong>need</strong> to do so). Thank you for enabling added security.<br/><br/>Please remember to keep your phone secure with a password, too.</value>
|
||||
</data>
|
||||
<data name="Login_BitIdRequired_Dialog" xml:space="preserve">
|
||||
<value><strong>BITID LOGIN REQUIRED</strong><br/><br/>This login requires BitId authentication, as enabled by the account holder. You cannot log on with a username/password combination.</value>
|
||||
</data>
|
||||
<data name="Login_GoogleAuthenticatorCode" xml:space="preserve">
|
||||
<value>2FA</value>
|
||||
</data>
|
||||
|
||||
@@ -115,6 +115,8 @@
|
||||
} else if (msg.d == "Fail") {
|
||||
// inform user of bad credentials by means of a red cross on _both_ boxes
|
||||
$('#TextLogin, #TextPass').css('background-image', "url('/Security/Images/iconshock-cross-12px.png')").css('background-position', 'right center').css('background-repeat', 'no-repeat');
|
||||
} else if (msg.d == "BitIdRequired") {
|
||||
alertify.alert(SwarmopsJS.unescape('<%=this.Localized_BitIdRequired_Dialog%>'));
|
||||
} else {
|
||||
// wut?
|
||||
}
|
||||
|
||||
@@ -316,6 +316,14 @@ namespace Swarmops.Pages.Security
|
||||
Person authenticatedPerson = Authentication.Authenticate (credentialsLogin,
|
||||
credentialsPass);
|
||||
|
||||
if (!string.IsNullOrEmpty(authenticatedPerson.BitIdAddress))
|
||||
{
|
||||
// We can't logon with username/password combo; bitID is activated and so
|
||||
// require it.
|
||||
|
||||
return "BitIdRequired";
|
||||
}
|
||||
|
||||
int lastOrgId = authenticatedPerson.LastLogonOrganizationId;
|
||||
|
||||
if (PilotInstallationIds.IsPilot (PilotInstallationIds.PiratePartySE) && (lastOrgId == 3 || lastOrgId == 0))
|
||||
@@ -348,7 +356,7 @@ namespace Swarmops.Pages.Security
|
||||
GuidCache.Set (logonUri + "-LoggedOn",
|
||||
Authority.FromLogin (authenticatedPerson, Organization.FromIdentity (lastOrgId)).ToEncryptedXml());
|
||||
|
||||
return "Success"; // Prepare here for "2FARequired" return code
|
||||
return "Success"; // Prepare here for "Additional2FARequired" return code
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
@@ -478,6 +486,11 @@ namespace Swarmops.Pages.Security
|
||||
public string signature { get; set; }
|
||||
}
|
||||
|
||||
public string Localized_BitIdRequired_Dialog
|
||||
{
|
||||
get { return Resources.Pages.Security.Login_BitIdRequired_Dialog; }
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user