Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/klirix/smol_auth
Smol authentication microservice
https://github.com/klirix/smol_auth
authentication passwordless passwordless-authentication
Last synced: 9 days ago
JSON representation
Smol authentication microservice
- Host: GitHub
- URL: https://github.com/klirix/smol_auth
- Owner: klirix
- License: mit
- Created: 2018-09-02T13:06:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T09:00:35.000Z (almost 2 years ago)
- Last Synced: 2023-04-29T18:55:44.414Z (over 1 year ago)
- Topics: authentication, passwordless, passwordless-authentication
- Language: JavaScript
- Size: 270 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Smol auth microservice
It's so smol it doesn't use DB, and keeps all data in-memory.
It essentially means that if service to be restarted, everybody who tries to enter will be invalidated, but well, it's almost pure.It uses mailgun email service, therefore the API key is required.
# Configuration
### Environment variables
MAILGUN_KEY - API key for Mailgun (required)
MAILGUN_DOMAIN - Domain name for Mailgun (required)
JWT_SECRET - Secret to sign the tokens with (default: ```"hahaha privacy yeah hight :-D BENIS"```)
BASE_HOST - base for the url, used for email link (default: ```"http://localhost:3000"```)
# Usage
To spin up dev verison use `yarn dev`/`npm run dev`
To spin up prod verison use `yarn start`/`npm start`# Endpoints
GET ```/enter/:email``` - requests an entery and returns a reference to entry session
GET ```/check/:ref``` - checks if entry session is validated, if so, returns a signed jwt, otherwise ```"Not yet"```, or ```"Wrong code"``` if ref is invalid
GET ```/confirm/:code``` - validates entry session and returns ```"Good"``` otherwise ```"Yeah right fuck off"``` if code is invalid
That's it