Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasliet/deno-user-auth
user crud poc api to use with deno deploy edge computing and deno kv persistence
https://github.com/lucasliet/deno-user-auth
Last synced: 16 days ago
JSON representation
user crud poc api to use with deno deploy edge computing and deno kv persistence
- Host: GitHub
- URL: https://github.com/lucasliet/deno-user-auth
- Owner: lucasliet
- Created: 2022-08-04T01:04:04.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T21:49:33.000Z (10 months ago)
- Last Synced: 2024-03-17T01:43:05.200Z (10 months ago)
- Language: TypeScript
- Homepage: https://user-auth.deno.dev
- Size: 108 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deno User Authentication
Simple user CRUD to use as a POC to [Deno Deploy](https://deno.com/deploy) with [Deno KV](https://deno.com/kv) persistence all in Edge Computing environment[![Run in Insomnia}](https://insomnia.rest/images/run.svg)](https://insomnia.rest/run/?label=deno-user-auth&uri=https%3A%2F%2Fraw.githubusercontent.com%2Flucasliet%2Fdeno-user-auth%2Fmaster%2F.github%2FInsomnia_2022-08-06.yaml)
## Speed Preview
![Speed Preview](https://raw.githubusercontent.com/lucasliet/deno-user-auth/master/.github/speed_preview.gif)
---
## Routes- **Login**
Resource: **POST** `/login`
Body:
```JSON
{
"user": "userName",
"password": "userPassword"
}
```Response:
```JSON
{
"expires_in": 3600,
"access_token": "generated_token"
}
```
> expires_in represents token expiration in seconds
---
- **Register**Resource: **POST** `/register`
Body:
```JSON
{
"user": "userName",
"password": "userPassword"
}
```Response:
```JSON
{
"message": "user userName registered sucessfully"
}
```
---
- **Unregister**Resource: **POST** `/unregister`
Authentication: `Bearer token`
Body:
```JSON
{
"user": "userName"
}
```Response:
```JSON
{
"message": "user teste unregistered sucessfully"
}
```
---
- **Update**Resource: **PUT** `/update_password`
Authentication: `Bearer token`
Body:
```JSON
{
"user": "userName",
"password": "userPassword"
}
```Response:
```JSON
{
"message": "user teste password updated sucessfully"
}
```
---
- **Verify Token**Resource: **GET** `/verify_token`
Authentication: `Bearer token`
Response:
```JSON
{
"expires_in": 3546,
"user": {
"id": "57b55019-9523-4cd8-99c0-403eaac35e95",
"name": "teste"
}
}
```
> expires_in represents token expiration in seconds