Migrating from a legacy system, help with ideas

Hello from Brazil, this is my first post here and I hope to participate a lot, because I’m really enjoying the framework. Well, I need some help with some ideas.

I’m migrating a system to use the Frappe framework, but it’s going to be a very slow curve because of the planning and the size of the system. But to continue using this new Frappe pipeline, I thought of the following.

Using iframes in the old system to load new modules. I’m trying out some ideas here, since the users of both systems have the same email, and are on the same domain, but with different subdomains.

  • What’s the best way to load doctypes on a full page?
  • Is it worth validating by session/cookie or is there a way to do this by JS events?
  • Has anyone done something like this? Is it too much work to do it by server rendering?

Welcome @frapperoger, you will get fun :wink:

You can get session cookie with
yoursite.com/api/method/login

See this
https://frappeframework.com/docs/user/en/guides/integration/rest_api/simple_authentication#post-api-method-login

Maybe you will need to configure allow_cors in site_config.json too

Simple Authentication text`

And … depending on your scenario, use auth hook for return right proper SameSite value. Framework will return Lax but many times ‘None’ without Secure will be required.

Check set_cookie method on auth.py

At last, consider NGINX config too
Hope this helps.

Thanks, I had found this step in the documentation, but it didn’t help me much because on the legacy system side, I only have the user’s email. I was able to search directly in the database, since I have access, but even when I access it with the cookie created in the browser, the framework doesn’t log me in directly. I need to create the cookie and when I access a screen, I need to be logged in.

Now, as for loading only a specific DocType on a screen, without menu for iframe loading the part on the legacy app. Can you help with that?