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

Deployment in subfolder breaks calls to back-end #49

Closed
nicowitteman opened this issue Oct 29, 2022 · 2 comments
Closed

Deployment in subfolder breaks calls to back-end #49

nicowitteman opened this issue Oct 29, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@nicowitteman
Copy link

nicowitteman commented Oct 29, 2022

In passwordless.login.js and passwordless.register.js, calls to back-end like "/pwmakeAssertion" don't work if the application is deployed in a subfolder like "https://somehost.com/myapplication/".
I suggest to
a) add this line to Login.cshtml and Register.cshtml:
<input type="hidden" id="BasePath" name="BasePath" value="@Url.Content("~")">
and
b) add a helper function like

function getFolder() {
    var dir = "";
    try {
        dir = document.getElementById('BasePath').value;
    } catch (e) {
    }
    return dir;
}

and then call
fetch(getFolder() + "/pwmakeAssertion" ....

@damienbod damienbod added the enhancement New feature or request label Oct 29, 2022
@damienbod
Copy link
Owner

@nicowitteman Thanks for the feedback! Would you like to do a PR? If not I will update

Greetings Damien

@nicowitteman
Copy link
Author

I prepared a PR, waiting for merge of #56

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

No branches or pull requests

2 participants