# redirects unauthorized users to passport

set $hash_auth "";

if ( $cookie_sessionid2 != "" ) {
    set $has_auth "1";
}

if ( $http_authorization != "" ) {
    set $has_auth "1";
}

if ( $has_auth = "" ) {
    return 302 https://passport.yandex-team.ru/auth?retpath=https://$http_host$request_uri;
}
