@kevisual/auth 1.0.4

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.
@@ -0,0 +1,18 @@
1
+ import jwt from 'jsonwebtoken';
2
+
3
+ /**
4
+ *
5
+ * @param user
6
+ * @param secret
7
+ *
8
+ * @param expiresIn default 7d expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d"
9
+ * @returns
10
+ */
11
+ declare const createToken: (user: {
12
+ id: string;
13
+ username: string;
14
+ [key: string]: any;
15
+ }, secret: string, expiresIn?: string) => Promise<string>;
16
+ declare const checkToken: (token: string, secret: string) => Promise<jwt.Jwt>;
17
+
18
+ export { checkToken, createToken };