Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dcrammer777 committed Nov 15, 2023
1 parent ee409b1 commit b36349a
Showing 1 changed file with 64 additions and 3 deletions.
67 changes: 64 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ This is a service that provides authentication for the other services in the sys

- Registration
- Login
- Logout
- Email verification
- SMS verification
- Magic links
- Password Reset
- Webhooks
- JWTs
- Token Refresh
- oAuth
- OAuth
- Configurable token providers
- Linking oAuth to user profile
- MFA
Expand All @@ -35,7 +39,64 @@ Register a new user.

```json
{
"email": "example@gmail.com", # required
"password": "password123" # optional, if not provided, a random password will be generated
"email": "example@mail.com", // required
"password": "password123", // optional, if not provided, a random password will be generated
"options": {
"sendEmail": true, // optional, defaults to true
"sendSms": true, // optional, defaults to false
"setCookie": false // optional, will set a cookie with the JWT, defaults to false
}
}
```

#### Response

Sets a cookie with the JWT if `options.setCookie` is true.

### POST /auth/unpw

Authenticates a user via username/password and returns a JWT.

#### Request

```json
{
"email": "example@mail.com", // required
"password": "password123", // required
"options": {
"setCookie": true // optional, will set a cookie with the JWT, defaults to true
}
}
```

#### Response

Sets a cookie with the JWT if `options.setCookie` is true.

### GET /auth/{provider}

Authenticates a user via an OAuth provider

#### Request

_None_

### Get /auth/{provider}/callback

Callback for OAuth provider

#### Request

_This endpoint is not meant to be called directly_

### GET /logout

Logs out the user and clears the JWT cookie. Also revokes the refresh token.

#### Request

_None_

#### Response

**200** Clears the JWT cookie.

0 comments on commit b36349a

Please sign in to comment.