mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-08 11:39:33 +00:00
pw requirements now loaded with jinja over js
Originally i loaded the requirements through calling the web api in javascript, but decided to switch it to jinja as i only recently found out its capable of stuff more complicated than replacing strings.
This commit is contained in:
@@ -3,6 +3,7 @@ from pathlib import Path
|
||||
from flask import Flask, send_from_directory, render_template
|
||||
from __main__ import config, app, g
|
||||
from __main__ import web_log as log
|
||||
from jellyfin_accounts.web_api import checkInvite, validator
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
@@ -25,7 +26,6 @@ def static_proxy(path):
|
||||
return render_template('404.html',
|
||||
contactMessage=config['ui']['contact_message']), 404
|
||||
|
||||
from jellyfin_accounts.web_api import checkInvite
|
||||
|
||||
|
||||
@app.route('/invite/<path:path>')
|
||||
@@ -48,6 +48,9 @@ def inviteProxy(path):
|
||||
helpMessage=config['ui']['help_message'],
|
||||
successMessage=config['ui']['success_message'],
|
||||
jfLink=config['jellyfin']['server'],
|
||||
validate=config.getboolean('password_validation',
|
||||
'enabled'),
|
||||
requirements=validator.getCriteria(),
|
||||
email=email)
|
||||
elif 'admin.html' not in path and 'admin.html' not in path:
|
||||
return app.send_static_file(path)
|
||||
|
||||
@@ -112,14 +112,6 @@ else:
|
||||
validator = PasswordValidator(0, 0, 0, 0, 0)
|
||||
|
||||
|
||||
@app.route('/getRequirements', methods=['GET', 'POST'])
|
||||
def getRequirements():
|
||||
data = request.get_json()
|
||||
log.debug('Password Requirements requested')
|
||||
if checkInvite(data['code']):
|
||||
return jsonify(validator.getCriteria())
|
||||
|
||||
|
||||
@app.route('/newUser', methods=['GET', 'POST'])
|
||||
def newUser():
|
||||
data = request.get_json()
|
||||
|
||||
Reference in New Issue
Block a user