You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I then make a GET request to http://localhost:4000/auth/session setting the Authorization Bearer Token to therientortackledgedeati:a76e3a98845b67f533f25070502a12cca1c97163 but I get the response unauthorized.
What am I doing wrong? From what I can see my example is inline with the demo example in the docs.
My server file is like so:
var express = require('express');
var http = require('http');
var bodyParser = require('body-parser');
var logger = require('morgan');
var cors = require('cors');
var path = require('path');
var SuperLogin = require('superlogin');
const superloginConfig = require('./superloginClient');
var superlogin = new SuperLogin(superloginConfig);
const routes = require('./routes');
var app = express();
app.set('port', process.env.PORT || 4000);
app.use(logger('dev'));
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
app.use(cors());
app.use('/auth', superlogin.router);
app.use('/api', routes)
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header('Access-Control-Allow-Methods', 'DELETE, PUT');
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
app.listen(app.get('port'));
console.log("App listening on " + app.get('port'));
Using Postman, I'm POSTing to
http://localhost:4000/auth/[email protected]&password=test
which returns a valid password and tokenI then make a GET request to
http://localhost:4000/auth/session
setting the Authorization Bearer Token totherientortackledgedeati:a76e3a98845b67f533f25070502a12cca1c97163
but I get the response unauthorized.What am I doing wrong? From what I can see my example is inline with the demo example in the docs.
My server file is like so:
and my config
The text was updated successfully, but these errors were encountered: