From 09a2c47edc510e65bcde8f7573f60887dff0b1e2 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Sun, 11 Aug 2019 12:18:08 +0200 Subject: [PATCH] normalize line endings --- model/models.py | 52 +++--- simple_auth_service.py | 38 ++-- templates/login-page.html | 356 +++++++++++++++++++------------------- 3 files changed, 223 insertions(+), 223 deletions(-) diff --git a/model/models.py b/model/models.py index c3ec4fd..e6c1eab 100644 --- a/model/models.py +++ b/model/models.py @@ -1,27 +1,27 @@ -from datetime import datetime,timedelta -from uuid import uuid1 -import secrets - -class Nounce(object): - def __init__(self): - self.id = uuid1() - self.expiration = datetime.now()+timedelta(seconds=60) - self.token = secrets.token_urlsafe() - - def expired(self): - return datetime.now() > self.expiration - - def bump(self): - self.expiration = datetime.now()+timedelta(seconds=60) - -class AuthSession(object): - def __init__(self, username): - self.id = uuid1() - self.expiration = datetime.now()+timedelta(minutes=30) - self.username = username - - def expired(self): - return datetime.now() > self.expiration - - def bumpExpiration(self): +from datetime import datetime,timedelta +from uuid import uuid1 +import secrets + +class Nounce(object): + def __init__(self): + self.id = uuid1() + self.expiration = datetime.now()+timedelta(seconds=60) + self.token = secrets.token_urlsafe() + + def expired(self): + return datetime.now() > self.expiration + + def bump(self): + self.expiration = datetime.now()+timedelta(seconds=60) + +class AuthSession(object): + def __init__(self, username): + self.id = uuid1() + self.expiration = datetime.now()+timedelta(minutes=30) + self.username = username + + def expired(self): + return datetime.now() > self.expiration + + def bumpExpiration(self): self.expiration = datetime.now()+timedelta(minutes=30) \ No newline at end of file diff --git a/simple_auth_service.py b/simple_auth_service.py index b303c5f..f0cc959 100644 --- a/simple_auth_service.py +++ b/simple_auth_service.py @@ -1,19 +1,19 @@ -#!/usr/bin/env python3 -from flask import * -import secrets -import nonce -import os.path - -app = Flask(__name__) -app.secret_key = secrets.token_urlsafe() -app.register_blueprint(nonce.app) - -ROUTES = {'routes': ['/', '/nonce'] } -@app.route('/') -def home(): - return jsonify(ROUTES) - -nonce.loadUsers( os.path.join('data','userlist.json') ) -if __name__ == '__main__': - app.run( host='0.0.0.0', port=7070) - +#!/usr/bin/env python3 +from flask import * +import secrets +import nonce +import os.path + +app = Flask(__name__) +app.secret_key = secrets.token_urlsafe() +app.register_blueprint(nonce.app) + +ROUTES = {'routes': ['/', '/nonce'] } +@app.route('/') +def home(): + return jsonify(ROUTES) + +nonce.loadUsers( os.path.join('data','userlist.json') ) +if __name__ == '__main__': + app.run( host='0.0.0.0', port=7070) + diff --git a/templates/login-page.html b/templates/login-page.html index da2e7ae..8cfbc30 100644 --- a/templates/login-page.html +++ b/templates/login-page.html @@ -1,179 +1,179 @@ - - - - - - - - - - -
- - - -
Login failed!
-
- + + + + + + + + + + +
+ + + +
Login failed!
+
+ \ No newline at end of file