@bhandari88/express-auth 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @bhandari88/express-auth
|
|
2
2
|
|
|
3
3
|
A plug-and-play authentication handler for Express.js with TypeScript supporting multiple authentication methods including email, username, phone, and social login (Google, Facebook).
|
|
4
4
|
|
|
5
|
+
## 📦 Package
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @bhandari88/express-auth
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Package URL**: [https://www.npmjs.com/package/@bhandari88/express-auth](https://www.npmjs.com/package/@bhandari88/express-auth)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
***Example Application**: [https://github.com/manojsinghindiit/auth-boiler-example](https://github.com/manojsinghindiit/auth-boiler-example)
|
|
17
|
+
|
|
5
18
|
## Features
|
|
6
19
|
|
|
7
20
|
- ✅ **Multiple Authentication Methods**
|
|
@@ -31,12 +44,6 @@ A plug-and-play authentication handler for Express.js with TypeScript supporting
|
|
|
31
44
|
- Optional refresh tokens
|
|
32
45
|
- Customizable user fields
|
|
33
46
|
|
|
34
|
-
## Installation
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm install @auth-boiler/express-auth
|
|
38
|
-
```
|
|
39
|
-
|
|
40
47
|
## Peer Dependencies
|
|
41
48
|
|
|
42
49
|
Make sure you have the following peer dependencies installed:
|
|
@@ -50,7 +57,7 @@ npm install express
|
|
|
50
57
|
### 1. Install Dependencies
|
|
51
58
|
|
|
52
59
|
```bash
|
|
53
|
-
npm install @
|
|
60
|
+
npm install @bhandari88/express-auth express
|
|
54
61
|
npm install --save-dev typescript @types/express @types/node
|
|
55
62
|
```
|
|
56
63
|
|
|
@@ -59,7 +66,7 @@ npm install --save-dev typescript @types/express @types/node
|
|
|
59
66
|
Implement the `UserRepository` interface for your database:
|
|
60
67
|
|
|
61
68
|
```typescript
|
|
62
|
-
import { UserRepository, UserDocument } from '@
|
|
69
|
+
import { UserRepository, UserDocument } from '@bhandari88/express-auth';
|
|
63
70
|
|
|
64
71
|
class MyUserRepository implements UserRepository {
|
|
65
72
|
async findById(id: string): Promise<UserDocument | null> {
|
|
@@ -100,7 +107,7 @@ class MyUserRepository implements UserRepository {
|
|
|
100
107
|
|
|
101
108
|
```typescript
|
|
102
109
|
import express from 'express';
|
|
103
|
-
import { Auth, AuthConfig } from '@
|
|
110
|
+
import { Auth, AuthConfig } from '@bhandari88/express-auth';
|
|
104
111
|
import MyUserRepository from './repositories/MyUserRepository';
|
|
105
112
|
|
|
106
113
|
const app = express();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhandari88/express-auth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Plug-and-play authentication handler for Express.js with TypeScript supporting email, username, phone, and social login",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"jsonwebtoken": "^9.0.2",
|
|
25
25
|
"passport": "^0.7.0",
|
|
26
|
-
"passport-google-oauth20": "^2.0.0",
|
|
27
26
|
"passport-facebook": "^3.0.0",
|
|
27
|
+
"passport-google-oauth20": "^2.0.0",
|
|
28
28
|
"validator": "^13.11.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/express": "^4.17.21",
|
|
32
32
|
"@types/jsonwebtoken": "^9.0.5",
|
|
33
|
+
"@types/node": "^20.10.5",
|
|
33
34
|
"@types/passport": "^1.0.16",
|
|
34
|
-
"@types/passport-google-oauth20": "^2.0.14",
|
|
35
35
|
"@types/passport-facebook": "^3.0.3",
|
|
36
|
+
"@types/passport-google-oauth20": "^2.0.14",
|
|
36
37
|
"@types/validator": "^13.11.7",
|
|
37
|
-
"
|
|
38
|
-
"typescript": "^5.3.3"
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"express": "^4.18.0"
|