<commit_before>package org.atlasapi.application.auth.www;

import static org.atlasapi.application.auth.OAuthTokenUserFetcher.OAUTH_PROVIDER_QUERY_PARAMETER;
import static org.atlasapi.application.auth.OAuthTokenUserFetcher.OAUTH_TOKEN_QUERY_PARAMETER;

import java.io.IOException;
import java.math.BigInteger;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.atlasapi.application.auth.UserFetcher;
import org.atlasapi.application.model.auth.OAuthProvider;
import org.atlasapi.application.users.User;
import org.atlasapi.output.ErrorResultWriter;
import org.atlasapi.output.ErrorSummary;
import org.atlasapi.output.NotAcceptableException;
import org.atlasapi.output.NotAuthenticatedException;
import org.atlasapi.output.QueryResultWriter;
import org.atlasapi.output.ResponseWriter;
import org.atlasapi.output.ResponseWriterFactory;
import org.atlasapi.output.UnsupportedFormatException;
import org.atlasapi.query.common.QueryContext;
import org.atlasapi.query.common.QueryResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.google.common.base.Optional;
import com.google.common.collect.Maps;
import com.metabroadcast.common.ids.NumberToShortStringCodec;
import com.metabroadcast.common.url.Urls;

@Controller
public class AuthController {
    private final ResponseWriterFactory writerResolver = new ResponseWriterFactory();
    private static Logger log = LoggerFactory.getLogger(AuthController.class);
    private final QueryResultWriter<OAuthProvider> resultWriter;
    private final UserFetcher userFetcher;
    private final NumberToShortStringCodec idCodec;
    private final String USER_URL = "/4/users/%s.%s";
    
    public AuthController(QueryResultWriter<OAuthProvider> resultWriter,
            UserFetcher userFetcher,
            NumberToShortStringCodec idCodec) {
        this.resultWriter = resultWriter;<commit_msg>Use absolute URL in auth redirects<commit_after>package org.atlasapi.application.auth.www;

import static org.atlasapi.application.auth.OAuthTokenUserFetcher.OAUTH_PROVIDER_QUERY_PARAMETER;
import static org.atlasapi.application.auth.OAuthTokenUserFetcher.OAUTH_TOKEN_QUERY_PARAMETER;

import java.io.IOException;
import java.math.BigInteger;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.metabroadcast.common.properties.Configurer;
import org.atlasapi.application.auth.UserFetcher;
import org.atlasapi.application.model.auth.OAuthProvider;
import org.atlasapi.application.users.User;
import org.atlasapi.output.ErrorResultWriter;
import org.atlasapi.output.ErrorSummary;
import org.atlasapi.output.NotAcceptableException;
import org.atlasapi.output.NotAuthenticatedException;
import org.atlasapi.output.QueryResultWriter;
import org.atlasapi.output.ResponseWriter;
import org.atlasapi.output.ResponseWriterFactory;
import org.atlasapi.output.UnsupportedFormatException;
import org.atlasapi.query.common.QueryContext;
import org.atlasapi.query.common.QueryResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.google.common.base.Optional;
import com.google.common.collect.Maps;
import com.metabroadcast.common.ids.NumberToShortStringCodec;
import com.metabroadcast.common.url.Urls;

@Controller
public class AuthController {
    private final ResponseWriterFactory writerResolver = new ResponseWriterFactory();
    private static Logger log = LoggerFactory.getLogger(AuthController.class);
    private final QueryResultWriter<OAuthProvider> resultWriter;
    private final UserFetcher userFetcher;
    private final NumberToShortStringCodec idCodec;
    private final String USER_URL = Configurer.get("atlas.uri").toString() + "/4/users/%s.%s";
    
    public AuthController(QueryResultWriter<OAuthProvider> resultWriter,
            UserFetcher userFetcher,
            NumberToShortStringCodec idCodec) {
        this.resultWriter = resultWriter;
{'fraction_non_alphanumeric': 0.08402419896930316, 'fraction_numerical': 0.0013443871835088505, 'mean_word_length': 6.306055646481179, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2656347', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1307, 'n_words': 217}