push the key
This commit is contained in:
parent
96c49d3622
commit
328db2f6e0
@ -144,6 +144,15 @@ def login_route(username: str, password: str) -> Response:
|
|||||||
return check_login(username, password)
|
return check_login(username, password)
|
||||||
|
|
||||||
|
|
||||||
|
@api_blueprint.route("/vapid-public-key", methods=["GET"])
|
||||||
|
def vapid_public_key():
|
||||||
|
"""Provides the VAPID public key."""
|
||||||
|
public_key = current_app.config["VAPID_PUBLIC_KEY"]
|
||||||
|
# Clean up the key
|
||||||
|
public_key = public_key.replace("-----BEGIN PUBLIC KEY-----", "").replace("-----END PUBLIC KEY-----", "").strip()
|
||||||
|
return jsonify({"public_key": public_key})
|
||||||
|
|
||||||
|
|
||||||
@api_blueprint.route("/save-subscription", methods=["POST"])
|
@api_blueprint.route("/save-subscription", methods=["POST"])
|
||||||
@requires_basic_auth
|
@requires_basic_auth
|
||||||
def save_subscription(username: str, password: str) -> Response:
|
def save_subscription(username: str, password: str) -> Response:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user