Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Ombi/commit/5b0a78894ecda351875ccbbc22321ad61e186a7e
You should set ROOT_URL correctly, otherwise the web may not work correctly.
1 changed files with
33 additions and
2 deletions
@ -24,9 +24,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
# endregion
using System.Linq ;
using Nancy ;
using Nancy.Responses.Negotiation ;
using PlexRequests.Api ;
using PlexRequests.Core ;
using PlexRequests.Core.SettingModels ;
using PlexRequests.UI.Models ;
@ -55,12 +58,40 @@ namespace PlexRequests.UI.Modules
private Response LoginUser ( )
{
var authenticated = false ;
var api = new PlexApi ( ) ;
var settings = AuthService . GetSettings ( ) ;
var username = Request . Form . username . Value ;
var password = string . Empty ;
if ( settings . UsePassword )
{
password = Request . Form . password . Value ;
}
if ( settings . UserAuthentication & & settings . UsePassword ) // Authenticate with Plex
{
}
else if ( settings . UserAuthentication ) // Check against the users in Plex
{
var users = api . GetUsers ( settings . PlexAuthToken ) ;
if ( users . User . Any ( x = > x . Username = = username ) )
{
authenticated = true ;
}
}
else if ( ! settings . UserAuthentication )
{
authenticated = true ;
}
// Add to the session
Session [ SessionKeys . UsernameKey ] = ( string ) username ;
return Response . AsJson ( new { Result = true } ) ;
return Response . AsJson ( authenticated
? new JsonResponseModel { Result = true }
: new JsonResponseModel { Result = false , Message = "Incorrect User or Password" } ) ;
}
}
}