Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log user account reset #279

Open
2 tasks done
SailReal opened this issue May 17, 2024 · 0 comments
Open
2 tasks done

Log user account reset #279

SailReal opened this issue May 17, 2024 · 0 comments
Labels
type:bug Something isn't working

Comments

@SailReal
Copy link
Member

Please agree to the following

Summary

Resetting a user account should create a log entry.

System Setup

- Hub: 1.3.4
- Keycloak: x
- Cryptomator: y

Steps to Reproduce

  1. Setup a user account
  2. Open a private tab in your browser and login again to Hub
  3. Click on "Account reset"

Expected Behavior

An event is logged that the account was reset.

Actual Behavior

Account reset is not logged.

Reproducibility

Always

Relevant Log Output

No response

Anything else?

We should add a new "Account reset entry" in

@POST
@Path("/me/reset")
@RolesAllowed("user")
@NoCache
@Transactional
@Operation(summary = "resets the user account")
@APIResponse(responseCode = "204", description = "deleted keys, devices and access permissions")
public Response resetMe() {
User user = userRepo.findById(jwt.getSubject());
user.setPublicKey(null);
user.setPrivateKey(null);
user.setSetupCode(null);
userRepo.persist(user);
deviceRepo.deleteByOwner(user.getId());
accessTokenRepo.deleteByUser(user.getId());
return Response.noContent().build();
}

@SailReal SailReal added the type:bug Something isn't working label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant