GigyaBundle icon indicating copy to clipboard operation
GigyaBundle copied to clipboard

Behaviour of createAuthenticatedToken()

Open mediafreakch opened this issue 13 years ago • 0 comments

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;
}

mediafreakch avatar Apr 04 '12 11:04 mediafreakch