public function loadUserByUsername($username)
    {
        if (!$this->authTokenService->isValid($username)) {
            throw new UsernameNotFoundException("Invalid Token.");
        }

        try {

            return $this->authTokenService->getUser($username);
        } catch (ProgrammerException $ex) {
            throw new UsernameNotFoundException($ex->getMessage(), $ex->getCode());
        }
    }
public function loadUserByUsername($username)
    {
        if (!$this->authTokenService->isValid($username)) {
            throw new UsernameNotFoundException("Invalid Token.");
        }

        try {

            return $this->authTokenService->getUser($username);
        } catch (ProgrammerException $ex) {
            throw new UsernameNotFoundException($ex->getMessage(), $ex->getCode());
        }
    }
public function loadUserByUsername ( $ username ) { if ( ! $ this -> authTokenService -> isValid ( $ username ) ) { throw new UsernameNotFoundException ( "Invalid Token." ) ; } try { return $ this -> authTokenService -> getUser ( $ username ) ; } catch ( ProgrammerException $ ex ) { throw new UsernameNotFoundException ( $ ex -> getMessage ( ) , $ ex -> getCode ( ) ) ; } }
Returns a user from the token payload if the token is valid and user_id in the payload is found otherwise
throws an exception

@param string $username
@return null|BaseUser
Returns a user from the token payload if the token is valid and user_id in the payload is found otherwise throws an exception