emonney / QuickApp

ASP.NET Core / Angular startup project template with complete login, user and role management. Plus other useful services for Quick Application Development
https://www.ebenmonney.com/quickapp
MIT License
1.26k stars 594 forks source link

Hosting in IIS - Application under 'Default Web Site' - Unable to login #46

Closed speddi closed 6 years ago

speddi commented 6 years ago

I created an application under 'Default Web Site' with name 'MyApp'. I am getting an error when trying to login. Some troubleshooting led me to this.

window.location.origin is coming as "http://localhost:8080/" and path as "myapp/login" instead of http://localhost:8080/myapp as the baseUrl.

Utiliites.ts

public static baseUrl() { if (window.location.origin) return window.location.origin

return window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');

}

emonney commented 6 years ago

'window.location.origin is coming as "http://localhost:8080/" and path as "myapp/login" instead of ' This is correct. location.origin shouldn't contain path.

Because you're hosting it as a sub application your home address will contain a path. Either host it as a separate/independent application under IIS or modify the code to return the base url you prefer (i.e. + /myapp).

Closing this. Feel free to reopen if this is still an issue.