Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin login #15

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions backend/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from flask import Flask, request, jsonify
from flask_cors import CORS
import os
from dotenv import load_dotenv

load_dotenv()

app = Flask(__name__)
CORS(app)
Expand All @@ -16,5 +20,17 @@ def api():
"totalPeople": 10000
}

@app.route('/verify-pin', methods=['POST'])
def verify_pin():
#Get the PIN the user submitted
submitted_pin = request.json.get('pin')

actual_pin = os.getenv('correct_pin')

if submitted_pin==actual_pin:
return jsonify({'status': 'success', 'message': 'correct pin!'})
else:
return jsonify({'status': 'error', 'message': 'incorrect pin - '+str(submitted_pin)})

if __name__ == "__main__":
app.run(debug=True)
Loading