ru.foodtechlab.lib.auth.service.domain.token.usecases.DeactivateAccessTokensByRefreshToken Maven / Gradle / Ivy
package ru.foodtechlab.lib.auth.service.domain.token.usecases;
import com.rcore.domain.commons.usecase.UseCase;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import ru.foodtechlab.lib.auth.service.domain.token.entity.RefreshTokenEntity;
import ru.foodtechlab.lib.auth.service.domain.token.port.AccessTokenRepository;
@RequiredArgsConstructor
public class DeactivateAccessTokensByRefreshToken extends UseCase {
private final AccessTokenRepository accessTokenRepository;
@Override
public OutputValues execute(InputValues inputValues) {
accessTokenRepository.deactivateAllAccessTokenByRefreshTokenId(inputValues.getRefreshTokenEntity().getId());
return new OutputValues();
}
@Value(staticConstructor = "of")
public static class InputValues implements UseCase.InputValues {
RefreshTokenEntity refreshTokenEntity;
}
public static class OutputValues implements UseCase.OutputValues {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy