GigyaBundle
GigyaBundle copied to clipboard
Behaviour of createAuthenticatedToken()
I have a question regarding the createAuthenticatedToken() function in GigyaProvider class. What exactly happens if inside loadUserByUsername() function a UsernameNotFoundException is thrown? Why do you return a token instead of throwing an AuthenticationException?
// https://github.com/opensky/GigyaBundle/blob/master/Security/Authentication/Provider/GigyaProvider.php
try {
$loaded = $this->userProvider->loadUserByUsername($user->getUsername());
} catch (UsernameNotFoundException $e) {
return $token;
}