Merge branch 'main' of https://git.azuze.fr/kawa/Sharepoint-Toolbox
This commit is contained in:
@@ -346,9 +346,25 @@ public partial class ProfileManagementViewModel : ObservableObject
|
||||
private bool CanRemoveApp()
|
||||
=> SelectedProfile != null && SelectedProfile.AppId != null && !IsRegistering;
|
||||
|
||||
/// <summary>
|
||||
/// Set by the view to display the pre-registration warning. Returns true if the
|
||||
/// user accepts and registration should proceed.
|
||||
/// </summary>
|
||||
public Func<string, bool>? ConfirmRegisterApp { get; set; }
|
||||
|
||||
private async Task RegisterAppAsync(CancellationToken ct)
|
||||
{
|
||||
if (SelectedProfile == null) return;
|
||||
|
||||
// Auth caching reduces this to one prompt in the common case, but a fresh
|
||||
// tenant or different admin account may still trigger up to two — warn so
|
||||
// the user knows another window is expected after they sign in.
|
||||
if (ConfirmRegisterApp != null)
|
||||
{
|
||||
var msg = string.Format(TranslationSource.Instance["profile.register.warning"], 2);
|
||||
if (!ConfirmRegisterApp(msg)) return;
|
||||
}
|
||||
|
||||
IsRegistering = true;
|
||||
ShowFallbackInstructions = false;
|
||||
RegistrationStatus = TranslationSource.Instance["profile.register.checking"];
|
||||
|
||||
Reference in New Issue
Block a user