public function resetPassword()
    {
        $data = $this->getData();

        if (!isset($data['token']) === 0) {
            throw new Exceptions\BadRequestException("you must provide a 'token'.");
        }
        if (!isset($data['password']) || strlen($data['password']) === 0) {
            throw new Exceptions\BadRequestException("you must provide a valid 'password'.");
        }

        // Set trusted context to update auths row
        Context::setTrusted(true);

        $auth = Auth::where(Auth::FORGOT_PASSWORD_FIELD, $data['token'])->first();
        if ($auth && $auth->resetPassword($data['password'])) {
            return array('success' => true);
        } else {
            throw new Exceptions\UnauthorizedException("invalid_token");
        }
    }
public function resetPassword()
    {
        $data = $this->getData();

        if (!isset($data['token']) === 0) {
            throw new Exceptions\BadRequestException("you must provide a 'token'.");
        }
        if (!isset($data['password']) || strlen($data['password']) === 0) {
            throw new Exceptions\BadRequestException("you must provide a valid 'password'.");
        }

        // Set trusted context to update auths row
        Context::setTrusted(true);

        $auth = Auth::where(Auth::FORGOT_PASSWORD_FIELD, $data['token'])->first();
        if ($auth && $auth->resetPassword($data['password'])) {
            return array('success' => true);
        } else {
            throw new Exceptions\UnauthorizedException("invalid_token");
        }
    }
public function resetPassword ( ) { $ data = $ this -> getData ( ) ; if ( ! isset ( $ data [ 'token' ] ) === 0 ) { throw new Exceptions \ BadRequestException ( "you must provide a 'token'." ) ; } if ( ! isset ( $ data [ 'password' ] ) || strlen ( $ data [ 'password' ] ) === 0 ) { throw new Exceptions \ BadRequestException ( "you must provide a valid 'password'." ) ; } // Set trusted context to update auths row Context :: setTrusted ( true ) ; $ auth = Auth :: where ( Auth :: FORGOT_PASSWORD_FIELD , $ data [ 'token' ] ) -> first ( ) ; if ( $ auth && $ auth -> resetPassword ( $ data [ 'password' ] ) ) { return array ( 'success' => true ) ; } else { throw new Exceptions \ UnauthorizedException ( "invalid_token" ) ; } }
Reset auth password
Reset auth password