All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.foodtechlab.lib.auth.service.domain.token.usecases.DeactivateAccessTokensByRefreshToken Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
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