public static RedirectionAction buildRedirectUrlAction(final WebContext context, final String location) {
        if (WebContextHelper.isPost(context) && useModernHttpCodes) {
            return new SeeOtherAction(location);
        } else {
            return new FoundAction(location);
        }
    }
Build the appropriate redirection action for a location.

@param context the web context
@param location the location
@return the appropriate redirection action
pac4j-core/src/main/java/org/pac4j/core/util/HttpActionHelper.java