Closed turnono closed 7 years ago
This is really more a stackoverflow question than a concrete issue? I would recommend comparing your code (and network traffic) with the superlogin-demo and/or the superlogin-client code. I also think you could simplify your example, to make it an easier to understand. For example the config for social login providers and the custom Redis config.
Am not sure about this headers.append( "Authorization", "Bearer {token}:{password}");
Where is token and password getting their values from?
I dont think you should enable authorization for login since one of the reasons for login is to get authorization
You can check your server code and remove this part that requires authorization on login "superlogin.requireAuth"
if you need to set authorization header in other part of your app, You can set authorization header like this
headers.append( "Authorization", Bearer ${details.token}:${details.password}
);
I am assuming the details object contain token and password field: the details might be a return value from register or login routes
Seems this was a Cloudant issue, the code I posted does work. I recreated the DBs on Cloudant and everything worked. Thanks so much
Hi, as I am still new to this so the problem is probably something simple but I just can't figure it for the past 3 days now.
Im using Superlogin in Ionic 2 with pouchDB. The server is deployed on Heroku (the config variables is my Cloudant details).
The login works and the session appears on the Cloudant website, but the token and password created by Superlogin does not allow me to access the Cloudent database from within the app (the error is 403. I get the same error if I try it from Postman with this token and password).
This is the login function:
The server code:
The superlogin.config.js code