Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi tenant Examples #260

Closed
wants to merge 6 commits into from
Closed

Multi tenant Examples #260

wants to merge 6 commits into from

Conversation

pboling
Copy link

@pboling pboling commented Dec 22, 2023

I got it working!

At least the parts that are tested. I'll add more.

I based this on top of branch https://github.com/janko/rodauth-rails/tree/url-helpers (PR #245) but also rebased on top of latest main as of 71eaf3d.

I did this because it looked like the url-helpers branch was building in the direction of what I needed.

janko and others added 6 commits December 22, 2023 13:37
This way we get access to String#delete_suffix and String#delete_prefix
methods.
Format suffixes won't be routed by Rodauth, so we can communicate that
when declaring the routes.
@janko
Copy link
Owner

janko commented Dec 22, 2023

Thanks for the PR. rodauth-rails doesn't have any special multi-tenancy support, so it wouldn't really make sense to add these examples to the test suite.

What would IMO be far more useful is a wiki page with instructions on how to configure rodauth-rails for multi-tenancy 😉 The wiki is publicly editable, so feel free to add a new page.

@janko janko closed this Dec 22, 2023
Comment on lines +51 to +53
segs = login_path.split('/')
segs.insert(-2, request.env[:path_key])
segs.join('/')
Copy link
Owner

@janko janko Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed, BTW? Won't the overridden #prefix method automatically add the path_key?

It seems you have two sources of path_key – the attribute accessor and request.env. Maybe that's why it isn't working?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't be there... It was one of my transitional hacks as I figured it out... Not sure why it is still there.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a wiki page once I have it all setup and working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants