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

Changing ROOT URL / /auth location #118

Closed
pat-s opened this issue Apr 29, 2021 · 8 comments
Closed

Changing ROOT URL / /auth location #118

pat-s opened this issue Apr 29, 2021 · 8 comments
Labels
🐛 bug Something isn't working

Comments

@pat-s
Copy link

pat-s commented Apr 29, 2021

Found a bug? Please fill out the sections below. 👍

Issue Summary

I would like to run calendso in a subdirectory.
While redirection works for the initial request, the /auth location seems to be hardcoded.
Hence all requests from within calendso are requesting $DOMAIN/auth instead of $DOMAIN/calendso/auth.

I would be ok with using $DOMAIN/auth but in my case I have another service already running at $DOMAIN/auth, hence I think there is a need for a dynamic ROOT URL variable within project.

@pat-s pat-s added the 🐛 bug Something isn't working label Apr 29, 2021
@emrysal
Copy link
Contributor

emrysal commented Apr 29, 2021

Hi @pat-s

Adding NEXTAUTH_URL=$DOMAIN/calendso/ (or NEXTAUTH_URL=$DOMAIN/calendso/api/auth) to your .env file may fix your issue.

@pat-s
Copy link
Author

pat-s commented Apr 29, 2021

Thanks! Looked promising but did not help.

Maybe because the default of the env var points to a localhost port and cannot accept a public URL therefore?

@baileypumfleet
Copy link
Contributor

Is running Calendso on a subdomain possible?

@emrysal
Copy link
Contributor

emrysal commented Apr 29, 2021

Hi @pat-s

Went a little deeper into the issue for you and I found nextauthjs/next-auth#499 with helpful suggestions;

Most relevant to your situation is nextauthjs/next-auth#499 (comment)

(P.s. no, public URLs work fine)

@pat-s
Copy link
Author

pat-s commented Apr 29, 2021

Thanks @emrysal, looks promising.
I tried setting NEXT_PUBLIC_NEXTAUTH_URL but without success unfortunately.

I am not into JS myself but it might be that additional changes in the code are required so that NEXT_PUBLIC_NEXTAUTH_URL is picked up?

Happy to test proposed solutions or to apply simple changes to the code.

Is running Calendso on a subdomain possible?

I have not tried yet because this would mean spinning up a new machine just for this service.
We would like to host it on a machine with many existing services (in a subpath).

@baileypumfleet
Copy link
Contributor

Changing the environment variable to prepend the NEXT_PUBLIC simply just exposes that environment variable to the client, and so it wouldn’t require a change in code. Furthermore, you are able to run Calendso on a subdomain using a machine with other existing services. Just use virtual hosts or soemthing, it’s super simple.

@pat-s
Copy link
Author

pat-s commented Apr 30, 2021

Changing the environment variable to prepend the NEXT_PUBLIC simply just exposes that environment variable to the client, and so it wouldn’t require a change in code.

Sure. The question was if it has an effect then / if the code is actually making use of the env var then.
I am not into JS and would like to avoid browsing source code of an unknown language if there are people with more knowledge around :)

< Furthermore, you are able to run Calendso on a subdomain using a machine with other existing services. Just use virtual hosts or soemthing, it’s super simple.

Thanks, I am aware of this possibility - working in the devops space :)
However, I would like to keep things together and concise and run it on a machine in a subpath where /auth is already occupied.
It would be great if this could be supported/documented by the project.
I am certainly not the only person with a need for such a configuration but I assume you might argue similar as in #116.

Thanks for your help.

@baileypumfleet
Copy link
Contributor

Yes, the code would be making use of the environment variable still, that shouldn’t be the issue. If nothing in the issue Alex mentioned earlier on Next-Auth’s repo doesn’t work, we may have to put this on hold for a while, as we don’t have the resources at the moment to be able to support lots of custom configurations, and therefore only support installations on their own domain/sub domain. Hopefully we can look at this further in the future

KATT added a commit that referenced this issue Sep 3, 2021
zomars pushed a commit that referenced this issue May 23, 2023
alexeybokov added a commit to CIENCE-Apps/cal.com that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants