# Multi tenant / multi subdomain

**URL:** <https://community.weweb.io/t/multi-tenant-multi-subdomain/18659>\
**Category:** Ask us anything\
**Tags:** authentication, supabase, weweb\
**Created:** [June 9, 2025, 12:22pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659 "2025-06-09T12:22:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![alias2696](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alias2696](https://community.weweb.io/u/alias2696)\
**Post date:** [June 9, 2025, 12:22pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/1 "2025-06-09T12:22:25Z")

</div>

hi,  
we are developing a multi tenant application which we intend to host in house.  
main website would be used for initial user signup and and signin but after initial signin we would like to redirect our users to their private tenant which would be hosted under [clientX.domain.com](http://clientX.domain.com).  
what is the best way to deal with authentication from this perspective? keep in mind that all ui’s will be developed in weweb using weweb integrations; right now we do supabase.

thank you  
P

---

<div class="post-metadata">

**Author:** ![Agustin\_Carozo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/agustin_carozo/32/13231_2.png) [@Agustin\_Carozo](https://community.weweb.io/u/Agustin_Carozo)\
**Post date:** [June 9, 2025, 6:18pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/2 "2025-06-09T18:18:33Z")

</div>

Hi there 👋

This question is a bit advanced for me so I’ll pass it down to our tech team.

Edit: This question has been solved on support chat.

---

<div class="post-metadata">

**Author:** ![alias2696](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alias2696](https://community.weweb.io/u/alias2696)\
**Post date:** [June 10, 2025, 8:11pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/3 "2025-06-10T20:11:37Z")

</div>

no, it was not. but thank you.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 11, 2025, 6:06am UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/4 "2025-06-11T06:06:52Z")

</div>

You gotta self host and use a Proxy

---

<div class="post-metadata">

**Author:** ![alias2696](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alias2696](https://community.weweb.io/u/alias2696)\
**Post date:** [June 11, 2025, 6:32am UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/5 "2025-06-11T06:32:07Z")

</div>

i am selfhosting. what do you mean by proxy? how would that help ?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 11, 2025, 6:39am UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/6 "2025-06-11T06:39:27Z")

</div>

Read about how proxies work and you’ll find out they allow you to route traffic in different ways.

---

<div class="post-metadata">

**Author:** ![alias2696](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alias2696](https://community.weweb.io/u/alias2696)\
**Post date:** [June 11, 2025, 7:53am UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/7 "2025-06-11T07:53:40Z")

</div>

i know how a proxy works, i was asking how would it help in this situation. we basically need to move weweb’s “is\_authenticated” from one subdomain to another.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 11, 2025, 7:59am UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/8 "2025-06-11T07:59:49Z")

</div>

I see, that won’t work. It’s not a WeWeb thing, but rather a browser thing. If you’re redirecting between domains, you could send the credentials via a query, but it’s very clunky and potentially not secure. I think you should handle auth per domain.

---

<div class="post-metadata">

**Author:** ![alias2696](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alias2696](https://community.weweb.io/u/alias2696)\
**Post date:** [June 11, 2025, 10:48am UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/9 "2025-06-11T10:48:51Z")

</div>

exactly. i cant do query because of security. what do you mean auth per domain? can you share a doc ?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 11, 2025, 12:22pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/10 "2025-06-11T12:22:28Z")

</div>

What you’re trying to do is not documented anywhere specifically within WeWeb. I think the simplest way would be to just not share the Auth between the pages, which in theory could be the default scenario.

---

<div class="post-metadata">

**Author:** ![Fishfrom96](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fishfrom96/32/12169_2.png) [@Fishfrom96](https://community.weweb.io/u/Fishfrom96)\
**Post date:** [June 11, 2025, 4:03pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/11 "2025-06-11T16:03:06Z")

</div>

I actually just started developing a multi tenant app myself this week. Though I decided against using WeWeb for this use case so I could use [https://usebasejump.com/](https://usebasejump.com/) with its components. Maybe you can take some inspiration from their docs.

---

<div class="post-metadata">

**Author:** ![Dylzzz](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@Dylzzz](https://community.weweb.io/u/Dylzzz)\
**Post date:** [June 16, 2025, 1:52pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/12 "2025-06-16T13:52:40Z")

</div>

setup your colours and logos etc for each tenant on a database table.

Use CoAlias to manage the domains. [https://coalias.com/](https://coalias.com/)

---

<div class="post-metadata">

**Author:** ![fnicoli](https://avatars.discourse-cdn.com/v4/letter/f/f04885/32.png) [@fnicoli](https://community.weweb.io/u/fnicoli)\
**Post date:** [June 16, 2025, 2:03pm UTC](https://community.weweb.io/t/multi-tenant-multi-subdomain/18659/13 "2025-06-16T14:03:12Z")

</div>

You don’t want to send authentication via query as it would leave your user vulnerable to impersonation by simply sharing an URL, but you might be able to set the auth cookie for the sub-domain while still on the domain page (set **[Domain=.example.com](http://Domain=.example.com)** with a dot prefix to apply to all sub-domains). I guess you would need control over the back-end to set cookies like that, or maybe you could do it with custom javascript on the auth workflow response.
