public function create(User $user, string $username, string $password): AuthenticationRecordInterface
    {
        $this->enforcePasswordStrength($password);

        $auth = $this->registerAuthenticationRecord($user, $username, $password);
        $this->setSessionCookies($auth);
        $this->setIdentity($user);

        return $auth;
    }
public function create(User $user, string $username, string $password): AuthenticationRecordInterface
    {
        $this->enforcePasswordStrength($password);

        $auth = $this->registerAuthenticationRecord($user, $username, $password);
        $this->setSessionCookies($auth);
        $this->setIdentity($user);

        return $auth;
    }
public function create ( User $ user , string $ username , string $ password ) : AuthenticationRecordInterface { $ this -> enforcePasswordStrength ( $ password ) ; $ auth = $ this -> registerAuthenticationRecord ( $ user , $ username , $ password ) ; $ this -> setSessionCookies ( $ auth ) ; $ this -> setIdentity ( $ user ) ; return $ auth ; }
Register a new user into the auth tables, and, log them in. Essentially calls registerAuthenticationRecord
and then stores the necessary cookies and identity into the service.

@param User   $user
@param string $username
@param string $password

@return AuthenticationRecordInterface
@throws PersistedUserRequiredException
Register a new user into the auth tables and log them in . Essentially calls registerAuthenticationRecord and then stores the necessary cookies and identity into the service .