<commit_before>
errors = require 'errors'

LoginError = class LoginError extends errors.BaseError

	key: 'login'
	template: "No such username/password."
		
exports.e2eLogin = $routeMock: ->
	
	path: 'e2e/user/login/:destination'
	
	controller: [
		'$location', '$routeParams', '$scope', 'socket', 'user'
		($location, $routeParams, $scope, socket, user) ->
			
			user.fakeLogin('cha0s').then ->
				$location.path "/user/#{$routeParams.destination}"
				
	]
	
exports.$errorType = -> LoginError

exports.$route = ->
	
	title: 'Sign in'
	
	controller: [
		'$location', '$scope', 'ui/notifications', 'user'
		($location, $scope, notifications, user) ->
			return $location.path '/' if user.isLoggedIn()
				
			$scope.userLogin =
				
				username:
					type: 'text'
					label: "Username"
					required: true
				
				password:
					type: 'password'
					label: "Password"<commit_msg>Organization<commit_after>
errors = require 'errors'

exports.e2eLogin = $routeMock: ->
	
	path: 'e2e/user/login/:destination'
	
	controller: [
		'$location', '$routeParams', '$scope', 'socket', 'user'
		($location, $routeParams, $scope, socket, user) ->
			
			user.fakeLogin('cha0s').then ->
				$location.path "/user/#{$routeParams.destination}"
				
	]
	
LoginError = class LoginError extends errors.BaseError

	key: 'login'
	template: "No such username/password."
		
exports.$errorType = -> LoginError

exports.$route = ->
	
	title: 'Sign in'
	
	controller: [
		'$location', '$scope', 'ui/notifications', 'user'
		($location, $scope, notifications, user) ->
			return $location.path '/' if user.isLoggedIn()
				
			$scope.userLogin =
				
				username:
					type: 'text'
					label: "Username"
					required: true
				
				password:
					type: 'password'
					label: "Password"
{'fraction_non_alphanumeric': 0.16185625353706848, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 3.2602409638554217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1874020', 'n_tokens_mistral': 698, 'n_tokens_neox': 557, 'n_words': 129}