Settings: change the login's password, or delete the login
A Login section in Settings changes the root's password (the current one given) and deletes the whole login, every persona with it, after its password and an explicit "I understand"; the client then signs out. Both use PrivaPub's existing /clientapi/user routes. The e2e signs up a login of its own, changes its password and deletes it, checking each against PrivaPub's login. Signing in now waits for either the feed or an enabled persona chooser, so a login with one persona (which goes on by itself) and a new persona's empty feed both sign in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
0bbab720a5
commit
228708c328
11 files changed
+258
-6
No files matched your search
@@ -114,6 +114,27 @@ namespace decePubClient.Services
|
||||
await authStateProvider.SetSession(jwtUser, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>Changes the root's password, the current one given.</summary>
|
||||
public async Task<WebResult> ChangePassword(UserPasswordForm form, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var response = await httpService.Post(APIs.ClientApi.POST_UpdatePassword, form, cancellationToken: cancellationToken);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return await response.Content.ReadWebResult(response.StatusCode, localizer, cancellationToken);
|
||||
|
||||
return new WebResult();
|
||||
}
|
||||
|
||||
/// <summary>Deletes the root, its password given: every persona of it and everything public they had, here and, as
|
||||
/// PrivaPub tells them, on the servers that hold it. The caller signs out afterwards.</summary>
|
||||
public async Task<WebResult> DeleteAccount(RemoveSelfForm form, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var response = await httpService.Post(APIs.ClientApi.POST_DeleteAccount, form, cancellationToken: cancellationToken);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return await response.Content.ReadWebResult(response.StatusCode, localizer, cancellationToken);
|
||||
|
||||
return new WebResult();
|
||||
}
|
||||
|
||||
/// <summary>Revokes every persona token the client holds, tells PrivaPub, then forgets the session and the local data.</summary>
|
||||
public async Task Logout(CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user