POST /incline/login
4060
def create
      if (@user = Incline::UserManager.authenticate(params[:session][:email], params[:session][:password], request.remote_ip))
        if @user.activated?
          # log the user in.
          log_in @user
          params[:session][:remember_me] == '1' ? remember(@user) : forget(@user)

          # show alerts on login.
          session[:show_alerts] = true

          redirect_back_or @user
        else
          flash[:safe_warning] = 'Your account has not yet been activated.<br/>Check your email for the activation link.'
          redirect_to main_app.root_url
        end
      else
        # deny login.
        flash.now[:danger] = 'Invalid email or password.'
        render 'new'
      end
    end
1329060
function login(type) {
	
	var input = getInput();
	
	var onDone = function (err, result) {
		if (err) {
			console.error(err);
			// switch for various errors
			switch (err) {				
				case 'ACCOUNT_EXISTS':
					alert(l_lang.err_exists);
					break;
				case 'INVALID_EMAIL':
					alert(l_lang.err_email);
					break;		
				case 'INVALID_ACCOUNT':
				case 'INVALID_PASSWORD_OR_TOKEN':
					alert(l_lang.err_notfound);
					break;					
				case 'INVALID_DATA':
				case 'UID_ERROR':
				case 'DB_ERROR':
				case 'GROUP_ERROR':
				default:
					alert(err);
					break;
			}
			return;
		}

		// do not redirect if it's just to reset password or register
		if (type === 'getpass')
			return;
		
		// try to login if register success
		if (type === 'register') {
			alert(l_lang.register_success);
			login('account');
			return;
		}
		
		alert(l_lang.login_success);
		window.location = '/main';		
	}
	
	switch (type) {
		case 'register':
			if (input.account === '' || input.password === '' || input.email === '') {
				return alert(l_lang.err_incomplete);	
			}
			SR.API._ACCOUNT_REGISTER(input, onDone);
			break;
		case 'account':
			console.log('calling _ACCOUNT_LOGIN');
			SR.API._ACCOUNT_LOGIN(input, onDone);
			break;
		case 'getpass':
			SR.API._ACCOUNT_RESETPASS(input, onDone);
			break;
		default:
			alert('unknown login type');
			break;
	}
}
843344
def login
      url = 'https://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/authenticate.ashx'

      options = { :query => { :loginID => username, :password => password }}
      response = HTTParty.post(url, options)

      token_from(response) # if response.instance_of? Net::HTTPOK
    end
379439
def do_login(self, line):
        ""
        if line:
            args = self.getargs(line)
            self.connect(args[0], args[1])
        else:
            self.connect()

        self.do_tables('')
182124
def post(self, path, query=None, data=None, redirects=True):
        
        return self.request('POST', path, query, data, redirects)
454370
def post_login(self, came_from=lurl('/')):
        
        if not request.identity:
            login_counter = request.environ.get('repoze.who.logins', 0) + 1
            redirect('/login',
                params=dict(came_from=came_from, __logins=login_counter))
        userid = request.identity['repoze.who.userid']
        flash(_('Welcome back, %s!') % userid)
        redirect(came_from)
126082
def login(options = {})
      body = { 
        body: {
          username: options[:username],
          password: options[:password],
          account_id: options[:account_id]
        }
      }
      self.class.post("/#{@api_ver}/auth/login", body)
    end
776249
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # synchronous operation
        user_oid = uri_parms[0]
        user_uri = '/api/users/' + user_oid
        try:
            user = hmc.lookup_by_uri(user_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        check_required_fields(method, uri, body, ['user-role-uri'])
        user_type = user.properties['type']
        if user_type in ('pattern-based', 'system-defined'):
            raise BadRequestError(
                method, uri, reason=314,
                message="Cannot add user role to user of type {}: {}".
                format(user_type, user_uri))
        user_role_uri = body['user-role-uri']
        try:
            hmc.lookup_by_uri(user_role_uri)
        except KeyError:
            raise InvalidResourceError(method, user_role_uri, reason=2)
        if user.properties.get('user-roles', None) is None:
            user.properties['user-roles'] = []
        user.properties['user-roles'].append(user_role_uri)
1233028
def post(self):
    """"""
    template_values = {
        'back_url': '/showCredentials',
        'back_msg': 'View Credentials',
        'logout_url': users.create_logout_url('/'),
        'user_nickname': users.get_current_user().nickname()
    }
    try:
      UpdateUserCredentials(self.request.get('client_id'),
                            self.request.get('client_secret'),
                            self.request.get('refresh_token'),
                            self.request.get('adwords_manager_cid'),
                            self.request.get('dev_token'))
      self.redirect('/showCredentials')
    except Exception, e:
      template_values['error'] = str(e)
      # Use template to write output to the page.
      path = os.path.join(os.path.dirname(__file__),
                          '../templates/base_template.html')
      self.response.out.write(template.render(path, template_values))
1187510
function postAuthLogout(req, res) {
    if (authMaintenance.usingSessions) {
      req.logout();
    }
    res.status(200).send('Ok');
  }
138621
def login(self):
        
        resp = super(CookieSession, self).request(
            'POST',
            self._session_url,
            data={'name': self._username, 'password': self._password},
        )
        resp.raise_for_status()
838389
public function postStep3()
    {
        $postData = Binput::all();

        $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2 + $this->rulesStep3);

        if ($v->passes()) {
            // Pull the user details out.
            $userDetails = Arr::pull($postData, 'user');

            $user = User::create([
                'username' => $userDetails['username'],
                'email'    => $userDetails['email'],
                'password' => $userDetails['password'],
                'level'    => User::LEVEL_ADMIN,
            ]);

            Auth::login($user);

            $setting = app(Repository::class);

            $settings = Arr::pull($postData, 'settings');

            foreach ($settings as $settingName => $settingValue) {
                $setting->set($settingName, $settingValue);
            }

            $envData = Arr::pull($postData, 'env');

            // Write the env to the .env file.
            execute(new UpdateConfigCommand($envData));

            if (Request::ajax()) {
                return Response::json(['status' => 1]);
            }

            return cachet_redirect('dashboard');
        }

        if (Request::ajax()) {
            return Response::json(['errors' => $v->getMessageBag()], 400);
        }

        return cachet_redirect('setup')->withInput()->withErrors($v->getMessageBag());
    }
1158747
function doLogin (opts, csrf, email, password) {
  return fetch(`${opts.host}/_/auth/login`, json({
    ...opts,
    method: 'post',
    body: { csrf, email, password }
  })).then((response) => props({
    session: getSessionCookie(response.headers.get('set-cookie')),
    body: getJSON(response)
  }))
}
640153
def login(self):
        """"""
        response = self.session.get(self.signin_url, verify=False)
        user_param, password_param = self._get_hashed_params(response.text)
        login_data = {
            user_param: self.config['username'],
            password_param: self.config['password'],
            'once': self._get_once(response.text),
            'next': '/'
        }
        headers = {'Referer': 'https://www.v2ex.com/signin'}
        self.session.post(self.signin_url, headers=headers, data=login_data)
90302
function _login (directoryUrl, publicUrl) {
  return (req, res) => {
    res.redirect(directoryUrl + '/login?redirect=' + encodeURIComponent(req.query.redirect || publicUrl))
  }
}
205546
@Override
    public List<Object> loginRequest() {
        if (loginParams == null)
            return null;
        return Arrays.asList("POST", loginPath, loginParams);
    }
994698
function postRouter(sessions, controllers, nonObjTemplatelogLevel, req, res, next) {

    if (req.originalUrl.match(/amorphic\/xhr\?path\=/) && url.parse(req.originalUrl, true).query.form && req.method === 'POST') {
        processPost(req, res, sessions, controllers, nonObjTemplatelogLevel);
    }
    else {
        next();
    }
}