mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-22 10:11:13 +00:00
Added ability to log in with jellyfin credentials
The new jellyfin_login and admin_only allow anyone use their username and password from jellyfin to login to the admin page, and restrict this to jellyfin admins only, respectively.
This commit is contained in:
@@ -7,7 +7,6 @@ import secrets
|
||||
import time
|
||||
from __main__ import config, config_path, app, g
|
||||
from __main__ import web_log as log
|
||||
from jellyfin_accounts.login import auth
|
||||
from jellyfin_accounts.validate_password import PasswordValidator
|
||||
|
||||
def resp(success=True, code=500):
|
||||
@@ -51,6 +50,8 @@ jf = Jellyfin(config['jellyfin']['server'],
|
||||
config['jellyfin']['device'],
|
||||
config['jellyfin']['device_id'])
|
||||
|
||||
from jellyfin_accounts.login import auth
|
||||
|
||||
attempts = 0
|
||||
success = False
|
||||
while attempts != 3:
|
||||
@@ -262,7 +263,6 @@ def deleteInvite():
|
||||
@auth.login_required
|
||||
def get_token():
|
||||
token = g.user.generate_token()
|
||||
log.debug('Token generated')
|
||||
return jsonify({'token': token.decode('ascii')})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user