https://github.com/sohanemon/genius-car-server
https://github.com/sohanemon/genius-car-server
backend jwt mongo server
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sohanemon/genius-car-server
- Owner: sohanemon
- Created: 2022-11-06T17:47:26.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-10T08:44:35.000Z (over 3 years ago)
- Last Synced: 2025-01-15T11:53:04.068Z (over 1 year ago)
- Topics: backend, jwt, mongo, server
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Create a secret key
```js
require("crypto").randomBytes(64).toString("hex");
```
## Passing to the header
```js
axios.post(
`${process.env.REACT_APP_server}/jwt`,
{ data: "" }, // at least something needs to be passed
{
headers: {
authorization: user.email,
},
}
);
```
> `axios.post(URI,body,config)` should be in this serial
- to use only config/headers as `axios.post(URI,'',config)` or `axios.post(URI,{},{headers: {token: 123})`