# Authentication

### We use 2 libraries to handle user authentication  [**@feathersjs/authentication**](https://github.com/feathersjs/authentication)  Feathers local, token, *and* OAuth authentication over REST and Websockets using JSON Web Tokens (JWT) with PassportJS.

\
[**feathers-authentication-management**](https://github.com/feathers-plus/feathers-authentication-management)\
Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication

#### How to Create a new user?

```perl
curl -X POST \
  http://localhost:3030/users \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 5ad6571f-e2dd-4737-b0e5-73d2fe8986fe' \
  -H 'cache-control: no-cache' \
  -d '{
	"email": "yourEmail@gmail.com",
	"password": "password"
}'
```

### How to Login?

```perl
curl -X POST \
  http://localhost:3030/authentication \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Postman-Token: 5b8c84e3-303f-4eb2-9a24-06418fb7e8a8' \
  -H 'cache-control: no-cache' \
  -d 'email=doron.nahum%2B10%40gmail.com&password=password&strategy=local'
```

### How To disable the verify email service?

set false at verifyEmail.enable in the config file

<div align="left"><img src="/files/-LYBGbHUZP2k8fMF-Iz5" alt=""></div>

### How to customize the verify and the reset view?

replace this html files in your public folder

<div align="left"><img src="/files/-LYBHD8uM3NTLvpD-5GZ" alt=""></div>

![](/files/-LfDRp4Q7Sl9wdIyBIau)

## [**authentication-management**](https://github.com/feathers-plus/feathers-authentication-management) **end points**

## **Please read this document** [**https://github.com/feathers-plus/feathers-authentication-management/blob/master/docs.md**](https://github.com/feathers-plus/feathers-authentication-management/blob/master/docs.md)

```
fetch('/authManagement', {
  method: 'POST',
  headers: { Accept: 'application/json' },
  body: JSON.stringify(
    { action: <ACTION NAME>,
    value: <VALUE> 
  })
})
```

### 1. Resend Verify Signup

```
{ 'action':'resendVerifySignup',
'value':{ 'email':'userEaail@gmail.com' } }
```

### 2. Check Unique

```
{ 
  'action':'checkUnique', 
  'value':{
    'email':'userEaail@gmail.com'
  }
}
```

### 3. Verify Signup Long

```
{ 
  'action':'verifySignupLong', 
  'value':'281813b93785a68e7590833bed58e5' 
}
```

### 4. Password Change

```
{
 'action':'passwordChange', 
 'value':{ 
 'user':{ 'email':'userEmail@gmail.com' }, 
 'oldPassword':'password', 'password':'1234578' 
 }}
```

### 5. Send Reset Pwd

```
{
 'action':'sendResetPwd',
 'value':{ 
   'email':'userEmail@gmail.com' 
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/version-2-support-feathers-4/docs/guides/authouriztion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
