public function logout(HTTPRequest $request)
    {
        $email = $request->requestVar('email');
        $member = Member::get()->filter(array('Email' => $email))->first();

        if ($member) {
            //logout
            $member->logout();

            if ($this->tokenConfig['owner'] === Member::class) {
                //generate expired token
                $tokenData = $this->generateToken(true);

                //write
                $tokenDBColumn = $this->tokenConfig['DBColumn'];
                $expireDBColumn = $this->tokenConfig['expireDBColumn'];

                $member->{$tokenDBColumn} = $tokenData['token'];
                $member->{$expireDBColumn} = $tokenData['expire'];
                $member->write();
            }
        }
    }
public function logout(HTTPRequest $request)
    {
        $email = $request->requestVar('email');
        $member = Member::get()->filter(array('Email' => $email))->first();

        if ($member) {
            //logout
            $member->logout();

            if ($this->tokenConfig['owner'] === Member::class) {
                //generate expired token
                $tokenData = $this->generateToken(true);

                //write
                $tokenDBColumn = $this->tokenConfig['DBColumn'];
                $expireDBColumn = $this->tokenConfig['expireDBColumn'];

                $member->{$tokenDBColumn} = $tokenData['token'];
                $member->{$expireDBColumn} = $tokenData['expire'];
                $member->write();
            }
        }
    }
public function logout ( HTTPRequest $ request ) { $ email = $ request -> requestVar ( 'email' ) ; $ member = Member :: get ( ) -> filter ( array ( 'Email' => $ email ) ) -> first ( ) ; if ( $ member ) { //logout $ member -> logout ( ) ; if ( $ this -> tokenConfig [ 'owner' ] === Member :: class ) { //generate expired token $ tokenData = $ this -> generateToken ( true ) ; //write $ tokenDBColumn = $ this -> tokenConfig [ 'DBColumn' ] ; $ expireDBColumn = $ this -> tokenConfig [ 'expireDBColumn' ] ; $ member -> { $ tokenDBColumn } = $ tokenData [ 'token' ] ; $ member -> { $ expireDBColumn } = $ tokenData [ 'expire' ] ; $ member -> write ( ) ; } } }
Logout a user from framework
and update token with an expired one
if token owner class is a Member

@param  HTTPRequest   $request    HTTP request containing 'email' var
Logout a user from framework and update token with an expired one if token owner class is a Member