mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[Captcha] Implement failed logins ceiling (#1870)
* [Hacker1] Failed Login Attempts Captcha * [Captcha] Implement failed logins ceiling * Formatting * Updated approach after implementation talks with Kyle * Updated email templates // Updated calling arch for failed attempts * Formatting * Updated 2fa email links * Renamed baserequest methods to better match their actions * EF migrations/scripts * Updated with requested changes * Defaults for MaxiumumFailedLoginAttempts
This commit is contained in:
1528
util/MySqlMigrations/Migrations/20220301215315_FailedLoginCaptcha.Designer.cs
generated
Normal file
1528
util/MySqlMigrations/Migrations/20220301215315_FailedLoginCaptcha.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
public partial class FailedLoginCaptcha : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "FailedLoginCount",
|
||||
table: "User",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LastFailedLoginDate",
|
||||
table: "User",
|
||||
type: "datetime(6)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FailedLoginCount",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastFailedLoginDate",
|
||||
table: "User");
|
||||
}
|
||||
}
|
||||
}
|
@ -1068,6 +1068,9 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.Property<string>("ExcludedGlobalEquivalentDomains")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("FailedLoginCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("ForcePasswordReset")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
@ -1091,6 +1094,9 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime?>("LastFailedLoginDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("LicenseKey")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
@ -0,0 +1,10 @@
|
||||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `User` ADD `FailedLoginCount` int NOT NULL DEFAULT 0;
|
||||
|
||||
ALTER TABLE `User` ADD `LastFailedLoginDate` datetime(6) NULL;
|
||||
|
||||
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
|
||||
VALUES ('20220301215315_FailedLoginCaptcha', '5.0.12');
|
||||
|
||||
COMMIT;
|
Reference in New Issue
Block a user