fix(auth): a password reset signs out Subsonic apps too, and a change can (#8107)
A reset ended every session but left the API key and Subsonic password working, and anyone signed in to the account can make either. So whoever had the account kept it through a Subsonic app after the owner reset the password. The forgotten-password reset and an admin's reset now replace the API key with one nobody holds and clear the Subsonic password. A self-service change keeps Subsonic apps signed in by default, since it would sign out the owner's own apps too. The web and Android password forms gain "Sign out Subsonic apps too", sent as sign_out_subsonic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,10 +35,17 @@ export type MyProfile = {
|
||||
|
||||
export type APITokenResponse = { api_token: string };
|
||||
|
||||
export async function changePassword(currentPassword: string, newPassword: string): Promise<void> {
|
||||
// signOutSubsonic also ends every Subsonic app's access (the API token and
|
||||
// the Subsonic password stop working), for a password someone else may know.
|
||||
export async function changePassword(
|
||||
currentPassword: string,
|
||||
newPassword: string,
|
||||
signOutSubsonic = false,
|
||||
): Promise<void> {
|
||||
await api.put('/api/me/password', {
|
||||
current_password: currentPassword,
|
||||
new_password: newPassword,
|
||||
sign_out_subsonic: signOutSubsonic,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user