package ee.tuleva.onboarding.auth;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value= HttpStatus.CONTINUE, reason="AUTHENTICATION_NOT_COMPLETE") //<- TODO: this is not working
public class MobileIdAuthNotCompleteException extends RuntimeException {
    MobileIdAuthNotCompleteException() {
        super("AUTHENTICATION_NOT_COMPLETE");
    }
}

package ee.tuleva.onboarding.auth;

import org.springframework.security.oauth2.common.exceptions.ClientAuthenticationException;

public class MobileIdAuthNotCompleteException extends ClientAuthenticationException {
    MobileIdAuthNotCompleteException() {
        super("Please keep polling.");
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "AUTHENTICATION_NOT_COMPLETE";
    }

    @Override
    public int getHttpErrorCode() {
        return 200; //TODO: change to something else
    }
}

Fix Mobile keep polling exception
Fix Mobile keep polling exception
