How do I get the domain and connect to the account via iFrame on my website?
-
Hi!
I'm trying to embed the site on my site, and indeed it works properly, I confirmed the embedding in >Settings>Advanced>iFrame Headers.
But there are two problems that I couldn't solve:
-
- I'm trying to get the link of the current page now in iFrame, but unfortunately it returns a 403 rejected.
-
- The same thing - 403 - also happens when I try to log in to my account or create a new account, through iFrame.
Have you tried this and managed to get it? I'd be happy if you could explain how you did it.
Thank you very much!
-
-
@baris Can you help me?
Thank you very much! -
@silverMan I would if I could
Is your site and nodebb on different domains? If POST requests are failing check if its a csrf issue.
-
@baris It is indeed two different domains.
How do I configure CSRF to work?
Because that’s the error in the log. -
You would need to make a request to yournodebb.com/api/config to get a csrf_token and then use that to make requests.
-
@baris Where can I find documentation on this?
I need to know what to configure on the site where I want to embed the forum. -
I don't think there is any documentation for it, if you want you can look at the client side code we have to make requests using a csrf_token, or our tests in the nodebb tests folder.