remove fingerprint.js

I don't think this was ever used or really has much use on this fork
This commit is contained in:
justcool393 2023-07-22 12:39:12 -05:00
parent 2edaec6933
commit a371d12c40
5 changed files with 0 additions and 60 deletions

File diff suppressed because one or more lines are too long

View file

@ -86,7 +86,6 @@ class User(CreatedBase):
controversial = Column(Boolean, default=False, nullable=False) controversial = Column(Boolean, default=False, nullable=False)
bio = deferred(Column(String)) bio = deferred(Column(String))
bio_html = Column(String) bio_html = Column(String)
fp = Column(String)
friends = deferred(Column(String)) friends = deferred(Column(String))
friends_html = deferred(Column(String)) friends_html = deferred(Column(String))
enemies = deferred(Column(String)) enemies = deferred(Column(String))

View file

@ -90,7 +90,6 @@ RATE_LIMITER_ENABLED = not bool_from_string(environ.get('DBG_LIMITER_DISABLED',
ENABLE_DOWNVOTES = not bool_from_string(environ.get('DISABLE_DOWNVOTES', False)) ENABLE_DOWNVOTES = not bool_from_string(environ.get('DISABLE_DOWNVOTES', False))
CARD_VIEW = bool_from_string(environ.get("CARD_VIEW", True)) CARD_VIEW = bool_from_string(environ.get("CARD_VIEW", True))
FINGERPRINT_TOKEN = environ.get("FP", None)
# other stuff from const.py that aren't constants # other stuff from const.py that aren't constants
CLUB_TRUESCORE_MINIMUM = int(environ.get("DUES").strip()) CLUB_TRUESCORE_MINIMUM = int(environ.get("DUES").strip())

View file

@ -966,27 +966,3 @@ def saved_comments(v, username):
page=page, page=page,
next_exists=next_exists, next_exists=next_exists,
standalone=True) standalone=True)
@app.post("/fp/<fp>")
@auth_required
def fp(v, fp):
v.fp = fp
users = g.db.query(User).filter(User.fp == fp, User.id != v.id).all()
if users: print(f'{v.username}: fp {v.fp}')
if v.email and v.is_activated:
alts = g.db.query(User).filter(User.email == v.email, User.is_activated, User.id != v.id).all()
if alts:
print(f'{v.username}: email {v.email}')
users += alts
for u in users:
li = [v.id, u.id]
existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).one_or_none()
if existing: continue
new_alt = Alt(user1=v.id, user2=u.id)
g.db.add(new_alt)
g.db.flush()
print(v.username + ' + ' + u.username)
g.db.add(v)
g.db.commit()
return '', 204

View file

@ -1,47 +1,15 @@
{% extends "default.html" %} {% extends "default.html" %}
{%- import 'component/sorting_time.html' as sorting_time -%} {%- import 'component/sorting_time.html' as sorting_time -%}
{% block desktopBanner %} {% block desktopBanner %}
{% if v and FINGERPRINT_TOKEN %}
{% if not v.fp %}
<script>
function fp(fp) {
const xhr = new XMLHttpRequest();
xhr.open("POST", '/fp/'+fp);
xhr.setRequestHeader('xhr', 'xhr');
var form = new FormData()
form.append("formkey", formkey());
xhr.send(form);
};
const fpPromise = new Promise((resolve, reject) => {
const script = document.createElement('script');
script.onload = resolve;
script.onerror = reject;
script.async = true;
script.src = "{{ 'js/fp.js' | asset }}";
document.head.appendChild(script);
})
.then(() => FingerprintJS.load({token: '{{FINGERPRINT_TOKEN}}'}));
fpPromise
.then(fp => fp.get())
.then(result => {if (result.visitorId != '{{v.fp}}') fp(result.visitorId);})
</script>
{% endif %}
{% endif %}
<div class="row" style="overflow: visible;padding-top:5px;"> <div class="row" style="overflow: visible;padding-top:5px;">
<div class="col"> <div class="col">
<div class="d-flex justify-content-between align-items-center pt-3 pb-2 sorting" style="float:right"> <div class="d-flex justify-content-between align-items-center pt-3 pb-2 sorting" style="float:right">
{% block navbar %} {% block navbar %}
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<a href="/submit" class="btn btn-secondary ml-2 mr-2 d-nowrap"> <a href="/submit" class="btn btn-secondary ml-2 mr-2 d-nowrap">
<i class="fas fa-edit mr-2 "></i> <i class="fas fa-edit mr-2 "></i>
Post Post
</a> </a>
<div class="dropdown dropdown-actions mx-2"> <div class="dropdown dropdown-actions mx-2">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if t=="hour" %}<i class="fas fa-clock mr-2 "></i> {% if t=="hour" %}<i class="fas fa-clock mr-2 "></i>
@ -69,7 +37,6 @@
</div> </div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %}"> <div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %}">