• Home
  • Categories
  • Recent
  • Popular
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Community

Jenine LiwanagJ

Jenine Liwanag

@Jenine Liwanag
About
Posts
3
Topics
1
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

    RE: Get current user session
  • Jenine LiwanagJ Jenine Liwanag

    @PitaJ I'm calling it on the client side, I'm using axios.get() to call the forum api. I have set the Access-Control-Allow-Origin to https://myapp.com - other api calls (ie. posts, tags) work just fine. Only when I call /api/me is when I get 401 Unauthorized. I tried calling /api/login but I get back an object that has loggedIn:false even tho a user is logged in the forums.


  • RE: Get current user session
  • Jenine LiwanagJ Jenine Liwanag

    @PitaJ I think I have a similar problem with navix. I'm running nodebb forums in a server with this domain forum.myapp.com, and I have my main site in a cdn (as it's just React app) in a different domain myapp.com.

    All login is handled on the forum site. In my main app, I need to know whether a current user is logged into the forum. I'm calling the forum api: forum.myapp.com/api/me from the main app and I'm getting "401 Unauthorized".

    But going to forum.myapp.com/api/me directly from the browser returns the logged in user data.

    I'm assuming it doesn't work because of a cookie not being set in the main app - as they are in a different domain. So are there any other way I can get the logged in user from the forum api?

    Thank you!


  • config.json changes after ./nodebb setup
  • Jenine LiwanagJ Jenine Liwanag

    After running ./nodebb setup, my config.json changed. It removes configuration of redis and socket.io.

    From this:

    {
        "url": "http://forum.test.com",
        "secret": "5eeff60a-123-4d0f-1234-01685fd23123",
        "database": "mongo",
        "port": ["4567", "4568"],
        "mongo": {
             ...
        },
        "socket.io": {
             ...
        },
        "redis": {
             ...
        }
    }
    

    to

    {
        "url": "http://forum.test.com",
        "secret": "5eeff60a-123-4d0f-1234-01685fd2123",
        "database": "mongo",
        "port": [
            "4567",
            "4568"
        ],
        "mongo": {
             ...
        }
    }
    

    Is this intended behaviour?

  • Login

  • Don't have an account? Register

  • Login or register to search.

  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
  • Login

  • Don't have an account? Register

  • Login or register to search.