Session tokens as a Service
Running a release build doesn't require any build steps and is usually the easiest way.
Windows, MacOS, Linux Download
git clone https://github.com/donuts-are-good/signupless.git
cd signupless
go get -d ./...
go run main.go
Signupless will run on port 8080 like this: http://localhost:8080/
Signupless offers two endpoints: /session/add
and /session/check
.
The /session/add
endpoint is used to add a new session. It requires a JSON payload with an id
field. It returns a session token.
{
"id": "user-123"
}
{
"id": "user-123",
"token": "f87d319fb7e58b0a439b8f9c17f37d76cf0e6591f27c8d33e45a2c96b6dd26e"
}
The /session/check
endpoint is used to check the validity of a session token. It requires the session token to be passed in the session-token
header. If the token is valid, a new token is returned.
GET /session/check HTTP/1.1
Host: localhost:8080
session-token: f87d319fb7e58b0a439b8f9c17f37d76cf0e6591f27c8d33e45a2c96b6dd26e
{
"id": "user-123",
"token": "759e19a7178d9771a6b52eabf1bcb9b8e365db0e325c305d227688a07e2f8f98"
}