If you are using a coding agent, copy and paste this prompt into your agent:
Add sign-in to this app using https://authito.com/llms.txtQuickstart
Authito is the easiest way to add authentication to your web applications.
Steps
- Sign in to Authito and create an app.
- Copy the auth token of the app.
- Put the token in the environment variable
AUTHITO_AUTH_TOKEN. - Add the middleware, as shown for your framework below.
Middleware
Node (Express)
npm install @authito/express// main.js
import express from 'express'
import { authito } from '@authito/express'
const app = express()
app.use(authito())
app.get('/', (req, res) => {
res.send(`Hello, ${req.user.name}`)
})
app.listen(3000)export AUTHITO_AUTH_TOKEN=<your token>
node main.jsPython (Flask)
pip install authito# main.py
from flask import Flask, g
from authito.flask import Authito
app = Flask(__name__)
Authito(app)
@app.get("/")
def home():
return f"Hello, {g.user.name}"export AUTHITO_AUTH_TOKEN=<your token>
flask --app main runGo
go get github.com/secretsdepot/authito-go// main.go
package main
import (
"fmt"
"net/http"
"github.com/secretsdepot/authito-go"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
user := authito.UserFrom(r.Context())
fmt.Fprintf(w, "Hello, %s", user.Name)
})
http.ListenAndServe(":3000", authito.Middleware(mux))
}export AUTHITO_AUTH_TOKEN=<your token>
go run main.go