Overriding NEXTAUTH_URL during runtime for multitenancy #8154
Replies: 3 comments
-
Did you find any solution? |
Beta Was this translation helpful? Give feedback.
-
short answer: No, it is not a good way to override environment variables in your code. So use this solution at your own risk. |
Beta Was this translation helpful? Give feedback.
-
Short Answer: It's not recommended, and multitenancy is not supported. Some devs may find a work around but if you don't know what you're doing then please look for an alternative option. I wasted a lot of time looking for it and, in the end, had to look for an alternative option. Clerk Auth supports it otherwise go for a custom auth solution. |
Beta Was this translation helpful? Give feedback.
-
Question 💬
Per this reply, I can override
NEXTAUTH_URL
dynamically and I've tested the same in my multitenant app and it is working correctly.Someone in the same thread mentioned that this approach isn't thread safe. Is it really a concern here and is this a good way to accommodate multi-tenancy since it is not supported officially as of now?
How to reproduce ☕️
N/A
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions