Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

qlik-auth.js

Hi guys,

Im using the qlik-auth.js in my custom authentication module. Everything works great except for deleting the session.

So when a user clicks on logout the application directs him to /logout route where the deleteSession(req, res, profile, options) is fired


However i am getting the following error and haven't found a way to fix it:

No matching endpoint found

^

SyntaxError: Unexpected token N

    at Object.parse (native)

    at IncomingMessage.<anonymous> (C:\****

project\node_modules\qlik-auth\index.js:307:35)

    at emitOne (events.js:77:13)

    at IncomingMessage.emit (events.js:169:7)

    at IncomingMessage.Readable.read (_stream_readable.js:360:10)

    at flow (_stream_readable.js:743:26)

    at resume_ (_stream_readable.js:723:3)

    at doNTCallback2 (node.js:439:9)

    at process._tickCallback (node.js:353:17)

[nodemon] app crashed - waiting for file changes before starting...

Thanks for any help.

13 Replies
Not applicable
Author

Hi Ralf,

Im using global middleware which gets launched in each route change app.use() which checks if the req.session.user is present. Also, Im not deleting the the session instance, but the actual user and all of its sessions instances Delete user ‒ Qlik Sense

var delSettings = {

            host: url.parse(options.ProxyRestUri).hostname,

            port: url.parse(options.ProxyRestUri).port,

            path : url.parse(options.ProxyRestUri).path+'/user/'+profile.UserDirectory+'/'+profile.UserId+'?xrfkey='+xrfkey,

            method: 'DELETE',

            headers: {

                'X-Qlik-Xrfkey': xrfkey,

                'Content-Type': 'application/json'},

            passphrase: options.PassPhrase,

            rejectUnauthorized: false,

            agent: false

        };

rbecher
MVP
MVP

Thanks, I'm doing exactly the same but getting a status 500 which means internal error..

Astrato.io Head of R&D
rbecher
MVP
MVP

No, not the same, using this: Delete user ‒ Qlik Sense

And then getting status 403.

Astrato.io Head of R&D
Not applicable
Author

if you console.log() your profile and options parameters which you pass into the request what do they show?