mirror of
https://github.com/bitwarden/server
synced 2025-12-17 08:43:27 +00:00
[PM-15015] Add Country Name to auth request from request headers (#5471)
* feat(pm-15015) : * Add `CountryName` column to AuthRequest Table in Database, and refreshing AuthRequestView * Modify database stored procedures and Entity Framework migrations for AuthRequest Repositories * Add property to `ICurrentContext` and response models.
This commit is contained in:
@@ -30,6 +30,7 @@ public class CurrentContext : ICurrentContext
|
||||
public virtual string DeviceIdentifier { get; set; }
|
||||
public virtual DeviceType? DeviceType { get; set; }
|
||||
public virtual string IpAddress { get; set; }
|
||||
public virtual string CountryName { get; set; }
|
||||
public virtual List<CurrentContextOrganization> Organizations { get; set; }
|
||||
public virtual List<CurrentContextProvider> Providers { get; set; }
|
||||
public virtual Guid? InstallationId { get; set; }
|
||||
@@ -104,6 +105,12 @@ public class CurrentContext : ICurrentContext
|
||||
{
|
||||
ClientVersionIsPrerelease = clientVersionIsPrerelease == "1";
|
||||
}
|
||||
|
||||
if (httpContext.Request.Headers.TryGetValue("country-name", out var countryName))
|
||||
{
|
||||
CountryName = countryName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async virtual Task BuildAsync(ClaimsPrincipal user, GlobalSettings globalSettings)
|
||||
|
||||
Reference in New Issue
Block a user