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

com.github.saphyra.authservice.common.DefaultErrorResponseResolver Maven / Gradle / Ivy

The newest version!
package com.github.saphyra.authservice.common;

import com.github.saphyra.authservice.auth.ErrorResponseResolver;
import com.github.saphyra.authservice.auth.domain.AuthContext;
import com.github.saphyra.authservice.auth.domain.RestErrorResponse;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class DefaultErrorResponseResolver implements ErrorResponseResolver {
    private final CommonAuthProperties commonAuthProperties;
    @Override
    public RestErrorResponse getRestErrorResponse(AuthContext authContext) {
        return new RestErrorResponse(
            authContext.getAccessStatus().getResponseStatus(),
            null
        );
    }

    @Override
    public String getRedirectionPath(AuthContext authContext) {
        return commonAuthProperties.getDefaultErrorRedirection();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy