File |
Mutation score |
# Killed |
# Survived |
# Timeout |
# No coverage |
# Errors |
Total detected |
Total undetected |
Total mutants |
|
---|---|---|---|---|---|---|---|---|---|---|
LoginController.js |
|
24/27 | 24 | 3 | 0 | 0 | 0 | 24 | 3 | 27 |
angular.module('juiceShop').controller('LoginController', 0[][
'$scope',
'$window',
'$location',
'$cookies',
'UserService',
function ($scope, $window, $location, $cookies, userService) 1{
}{
'use strict'
var email = $cookies.get('email')
if (2false3trueemail) 4{
}{
$scope.user = {}
$scope.user.email = email
$scope.rememberMe = 5falsetrue
} else 6{
}{
$scope.rememberMe = 7truefalse
}
$scope.login = function () 8{
}{
userService.login($scope.user).then(function (authentication) 9{
}{
$cookies.put('token', authentication.token)
$window.sessionStorage.bid = authentication.bid
$location.path('/')
}).catch(function (error) 10{
}{
$cookies.remove('token')
delete $window.sessionStorage.bid
$scope.error = error
$scope.form.$setPristine()
})
if (11false12true$scope.rememberMe) 13{
}{
$cookies.put('email', $scope.user.email)
} else 14{
}{
$cookies.remove('email')
}
}
$scope.googleLogin = function () 15{
}{
$window.location.replace(16oauthProviderUrl + '?client_id=' + clientId + '&response_type=token&scope=email&redirect_uri=' - authorizedRedirectURIs[redirectUri]17oauthProviderUrl + '?client_id=' + clientId - '&response_type=token&scope=email&redirect_uri='18oauthProviderUrl + '?client_id=' - clientId19oauthProviderUrl - '?client_id='oauthProviderUrl + '?client_id=' + clientId + '&response_type=token&scope=email&redirect_uri=' + authorizedRedirectURIs[redirectUri])
}
var oauthProviderUrl = 'https://accounts.google.com/o/oauth2/v2/auth'
var clientId = '1005568560502-6hm16lef8oh46hr2d98vf2ohlnj4nfhq.apps.googleusercontent.com'
var authorizedRedirectURIs = {
'https://juice-shop.herokuapp.com': 'https://juice-shop.herokuapp.com',
'http://juice-shop.herokuapp.com': 'http://juice-shop.herokuapp.com',
'https://juice-shop-staging.herokuapp.com': 'https://juice-shop-staging.herokuapp.com',
'http://juice-shop-staging.herokuapp.com': 'http://juice-shop-staging.herokuapp.com',
'http://localhost:3000': 'http://localhost:3000',
'http://juice.sh': 'http://juice.sh',
'http://192.168.99.100:3000': 'http://tinyurl.com/ipMacLocalhost',
'http://manicode.us/juice-shop': 'http://manicode.us/juice-shop'
}
var redirectUri = 20$location.protocol() + '://' - location.host21$location.protocol() - '://'$location.protocol() + '://' + location.host
$scope.oauthUnavailable = 22authorizedRedirectURIs[redirectUri]!authorizedRedirectURIs[redirectUri]
if (23true24false$scope.oauthUnavailable) 25{
}{
console.log(26redirectUri - ' is not an authorized redirect URI for this application.'redirectUri + ' is not an authorized redirect URI for this application.')
}
}])