Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Replit authentication is an amazing thing. This package provides an easy way to use it.
from flask_replit_auth import replit_auth
from flask import request, Flask
app = Flask(__name__)
replit_auth(app)
@app.route("/")
def index():
if request.user:
return request.user['username']
else:
return 'Not logged in!'
if __name__ == "__main__":
app.run(host='0.0.0.0')
Initialize replit auth on your app by calling replit_auth(app)
, after creating your flask app. To get information, call request.user
, which will either return None
or a dict
with the information.
var button = document.getElementById('login_with_replit');
if (location.protocol !== 'https:') {
alert('Replit auth requires https!');
}
button.onclick = function() {
window.addEventListener('message', authComplete);
var h = 500;
var w = 350;
var left = (screen.width / 2) - ( w / 2);
var top = (screen.height / 2) - (h / 2);
var authWindow = window.open('https://replit.com/auth_with_repl_site?domain=' + location.host, '_blank', 'modal=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left)
function authComplete(e) {
if (e.data !== 'auth_complete') {
return;
}
window.removeEventListener('message', authComplete);
authWindow.close();
// Reload the page to get the credentials.
location.reload();
}
}
Usage:
id
of you login button to login_with_replit
.FAQs
Brings replit auth to flask.
We found that flask-replit-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.