5
0
Fork 0
Beep backend handling login.
 
 
Go to file
UnicodingUnicorn e82b4b400e Use env for config instead of flags 2019-02-18 23:43:24 +08:00
.env Use env for config instead of flags 2019-02-18 23:43:24 +08:00
.gitignore Initial commit 2019-02-10 18:43:02 +08:00
Dockerfile Use env for config instead of flags 2019-02-18 23:43:24 +08:00
README.md Use env for config instead of flags 2019-02-18 23:43:24 +08:00
go.mod Use env for config instead of flags 2019-02-18 23:43:24 +08:00
go.sum Use env for config instead of flags 2019-02-18 23:43:24 +08:00
main.go Use env for config instead of flags 2019-02-18 23:43:24 +08:00

README.md

backend-login

Beep backend handling login. For now, just a POST endpoint returning a JWT. In the furture, SMS-based perpetual login.

Environment variables

Supply environment variables by either exporting them or editing .env.

ENV Description Default
LISTEN Host and port number to listen on :8080
SECRET JWT secret secret

API (temporary)

POST /login

Body

Name Type Description Required
user String User's ID.
device String Device's ID. Must be unique to the device. I suggest something based on MAC address.

Success (200 OK)

JWT token.

Errors

Code Description
400 Required fields in body were not supplied
500 Error creating the JWT