jakubgarfield / Bonobo-Git-Server

Bonobo Git Server for Windows is a web application you can install on your IIS and easily manage and connect to your git repositories. Go to homepage for release and more info.
http://bonobogitserver.com
MIT License
1.81k stars 603 forks source link

Added hotfix for initial WindowsAuthentication use. #763

Open CatStarwind opened 6 years ago

CatStarwind commented 6 years ago

Attempt to fix #743 .

willdean commented 6 years ago

Thanks for this, but I feel like something more fundamental is wrong here - there should be a general way of bouncing people to the correct login page, which doesn't have to be reimplemented all over the place. This is, after all, how this used to work, because the framework did the bounce using an attribute.

Could we perhaps have the Home/Logon action do a redirect to WindowsLogin if it's needed?

CatStarwind commented 6 years ago

I believe this is the commit that introduced this bug: https://github.com/jakubgarfield/Bonobo-Git-Server/commit/a4b29666bc2f820eed058b0a39b5f51b7bf8d300#diff-542396835ce4976bb130a2c3363ed972

willdean commented 6 years ago

@CatStarwind Yes, you're quite right, that's where it comes from - unfortunately the author of that PR doesn't appear to be around any more.

Would you be able to look at my suggestion about fixing this in the Home/Logon action rather than in RepoController/Index (which I think should have as little Auth-specific code in as possible)?

CatStarwind commented 6 years ago

I remember trying before but being at a loss in trying to find a way without having to import an entire scope. There didn't seem to be a way to check for WindowsAuthenticationProvider in the HomeController. :\

I'll try giving it a second attempt.

CatStarwind commented 6 years ago

Apologies for the double commit (still not accustomed to using GitHub) but would this work @willdean ?