mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-11-28 17:28:36 +01:00
- Upgrade AudibleApi NuGet package reference from 14.1.2 to 14.1.3 - Support Bearer access token authentication alongside ADP request signing - Proactively validate tokens and evaluate account SignInStatus (None, Modern, Legacy) - Add tri-state 'Signed in?' checkbox in Avalonia and WinForms Accounts dialogs - In ApiExtended, dynamically set Api.AuthenticationMethods based on tokens held by account - Handle legacy credential rejections gracefully and guide user to re-authenticate - In CLI, report modern vs legacy authentication status and support forced re-login - Add comprehensive unit tests and user documentation
28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
using AudibleUtilities;
|
|
using System;
|
|
|
|
namespace LibationUiBase;
|
|
|
|
/// <summary>Shared copy for the dialog shown when auto-scan pauses itself waiting for a login.</summary>
|
|
public static class AutoScanAuthPrompt
|
|
{
|
|
public const string Caption = "Auto-scan paused - login required";
|
|
|
|
public static string FormatBody(AuthenticationRequiredException ex)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(ex);
|
|
|
|
// the owner is looking at their own screen, so the dialog names the account in full. the log gets
|
|
// ex.AccountInfo.MaskedLogEntry instead
|
|
var account = ex.AccountInfo?.RevealOwnerFacingLabel() ?? "an Audible account";
|
|
var cause = ex.AccountInfo?.RequiresReRegistration == true
|
|
? "that account requires a fresh login and device registration"
|
|
: ex.AccountInfo?.LooksLikeMissingCredentials ?? true
|
|
? "that account has never been logged in, or its stored credentials are missing"
|
|
: "the stored login for that account expired";
|
|
|
|
return $"Libation could not refresh the Audible library for {account} because {cause}.\n\n"
|
|
+ "Background auto-scan has been paused. Use Import > Scan Library to log in for that account and resume periodic scans.";
|
|
}
|
|
}
|