lokenx / lokenx/plexrequests-meteor
Internal Error 500 on Login
@RickyGrassmuck is already working on this.
Since Dec 15, 2017.
- Dominant language
- JavaScript
- Stars
- 521
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
Issue:
Getting an internal error when trying to login with either a username or email when "Require users to login with their passwords" is NOT enabled, but "Enable user authentication" is enabled.
The error occurs in this file: https://github.com/lokenx/plexrequests-meteor/blob/master/server/methods/authentication/plexAuthentication.js
In the function 'checkPlexUser', specifically in the return case. This is because earlier, there is an if condition:
if (Settings.find({}).fetch()[0].plexAuthenticationPASSWORDS) {
// If passwords are required check full login
var userInfo = Meteor.call('plexLogin', plexLogin, plexPassword)
var plexUsername = userInfo.username
}
plexUsername is not defined if plexAuthenticationPASSWORDS isn't enabled, and in the return:
return (friendsList.indexOf(plexUsername.toLowerCase()) > -1), the toLowerCase() function fails on a null variable.
Attempted Solution:
I set plexUsername before the if condition to the plexLogin supplied to the function, and this worked and allowed login via plex username but it now fails to login throwing an incorrect login error instead. This is because that if statement fetched the username via the login information.
I am not sure if the Plex API allows you to fetch a username from an email without a password.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.