private function login(ServerRequestInterface $request)
    {
        //Check header
        $authorization = $this->parseHeader($request->getHeaderLine('Authorization'));

        if (!$authorization) {
            return false;
        }

        //Check the user
        if (!isset($this->users[$authorization['username']])) {
            return false;
        }

        if ($this->users[$authorization['username']] !== $authorization['password']) {
            return false;
        }

        return $authorization['username'];
    }
private function login(ServerRequestInterface $request)
    {
        //Check header
        $authorization = $this->parseHeader($request->getHeaderLine('Authorization'));

        if (!$authorization) {
            return false;
        }

        //Check the user
        if (!isset($this->users[$authorization['username']])) {
            return false;
        }

        if ($this->users[$authorization['username']] !== $authorization['password']) {
            return false;
        }

        return $authorization['username'];
    }
private function login ( ServerRequestInterface $ request ) { //Check header $ authorization = $ this -> parseHeader ( $ request -> getHeaderLine ( 'Authorization' ) ) ; if ( ! $ authorization ) { return false ; } //Check the user if ( ! isset ( $ this -> users [ $ authorization [ 'username' ] ] ) ) { return false ; } if ( $ this -> users [ $ authorization [ 'username' ] ] !== $ authorization [ 'password' ] ) { return false ; } return $ authorization [ 'username' ] ; }
Check the user credentials and return the username or false.

@return false|string
Check the user credentials and return the username or false .