diff --git a/src/Core/Abstractions/IApiService.cs b/src/Core/Abstractions/IApiService.cs index 269cb04ec..68d0340be 100644 --- a/src/Core/Abstractions/IApiService.cs +++ b/src/Core/Abstractions/IApiService.cs @@ -91,7 +91,7 @@ namespace Bit.Core.Abstractions Task GetAuthRequestAsync(string id); Task GetAuthResponseAsync(string id, string accessCode); Task PutAuthRequestAsync(string id, string key, string masterPasswordHash, string deviceIdentifier, bool requestApproved); - Task PostCreateRequestAsync(PasswordlessCreateLoginRequest passwordlessCreateLoginRequest); + Task PostCreateRequestAsync(PasswordlessCreateLoginRequest passwordlessCreateLoginRequest, AuthRequestType authRequestType); Task GetKnownDeviceAsync(string email, string deviceIdentifier); Task GetDeviceByIdentifierAsync(string deviceIdentifier); Task UpdateTrustedDeviceKeysAsync(string deviceIdentifier, TrustedDeviceKeysRequest deviceRequest); diff --git a/src/Core/Services/ApiService.cs b/src/Core/Services/ApiService.cs index 95af20a55..aab6b3c35 100644 --- a/src/Core/Services/ApiService.cs +++ b/src/Core/Services/ApiService.cs @@ -591,9 +591,9 @@ namespace Bit.Core.Services return SendAsync(HttpMethod.Get, $"/auth-requests/{id}/response?code={accessCode}", null, false, true); } - public Task PostCreateRequestAsync(PasswordlessCreateLoginRequest passwordlessCreateLoginRequest) + public Task PostCreateRequestAsync(PasswordlessCreateLoginRequest passwordlessCreateLoginRequest, AuthRequestType authRequestType) { - return SendAsync(HttpMethod.Post, $"/auth-requests", passwordlessCreateLoginRequest, false, true); + return SendAsync(HttpMethod.Post, authRequestType == AuthRequestType.AdminApproval ? $"/auth-requests/admin-request" : $"/auth-requests", passwordlessCreateLoginRequest, false, true); } public Task PutAuthRequestAsync(string id, string encKey, string encMasterPasswordHash, string deviceIdentifier, bool requestApproved) diff --git a/src/Core/Services/AuthService.cs b/src/Core/Services/AuthService.cs index d05c081a7..31bcfefea 100644 --- a/src/Core/Services/AuthService.cs +++ b/src/Core/Services/AuthService.cs @@ -632,7 +632,7 @@ namespace Bit.Core.Services var publicB64 = Convert.ToBase64String(keyPair.Item1); var accessCode = await _passwordGenerationService.GeneratePasswordAsync(PasswordGenerationOptions.CreateDefault.WithLength(25)); var passwordlessCreateLoginRequest = new PasswordlessCreateLoginRequest(email, publicB64, deviceId, accessCode, authRequestType, fingerprintPhrase); - var response = await _apiService.PostCreateRequestAsync(passwordlessCreateLoginRequest); + var response = await _apiService.PostCreateRequestAsync(passwordlessCreateLoginRequest, authRequestType); if (response != null) { diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index ab77da33f..ed0ae3ec4 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -17,7 +17,6 @@ using CoreFoundation; using CoreNFC; using Foundation; using UIKit; -using Xamarin.Essentials; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS;