flashauthbyjagwar 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/dist/APIs/API.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
interface UserData {
|
|
2
|
-
success: boolean;
|
|
3
|
-
message: string;
|
|
4
|
-
data: any;
|
|
5
|
-
}
|
|
6
1
|
export declare function GetGoogleLoginURL(serverURL: string, clientId: string): Promise<string>;
|
|
7
2
|
export declare function SignUpWithJWT(serverURL: string, clientId: string, name: string, email: string, password: string): Promise<string>;
|
|
8
3
|
export declare function SingInWithJWT(serverURL: string, clientId: string, email: string, password: string): Promise<any>;
|
|
9
|
-
export declare function FetchProfile(serverURL: string, clientId: string, token: string): Promise<
|
|
10
|
-
export {};
|
|
4
|
+
export declare function FetchProfile(serverURL: string, clientId: string, token: string): Promise<any>;
|
|
11
5
|
//# sourceMappingURL=API.d.ts.map
|
package/dist/APIs/API.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"API.d.ts","sourceRoot":"","sources":["../../src/APIs/API.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"API.d.ts","sourceRoot":"","sources":["../../src/APIs/API.ts"],"names":[],"mappings":"AAQA,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4B5F;AAgBD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBvI;AAKD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,gBAyBrG;AAWD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAoBpF"}
|
package/dist/APIs/API.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
1
|
export async function GetGoogleLoginURL(serverURL, clientId) {
|
|
3
2
|
if (!clientId || !serverURL) {
|
|
4
3
|
throw new Error("Missing client ID or server url");
|
|
@@ -32,15 +31,19 @@ export async function SignUpWithJWT(serverURL, clientId, name, email, password)
|
|
|
32
31
|
}
|
|
33
32
|
try {
|
|
34
33
|
const payload = {
|
|
35
|
-
name, email, password
|
|
34
|
+
name, email, password, authType: 'local'
|
|
36
35
|
};
|
|
37
|
-
const
|
|
36
|
+
const url = `${serverURL}/api/flashauth/local/signup`;
|
|
37
|
+
const res = await fetch(url, {
|
|
38
|
+
method: 'POST',
|
|
38
39
|
headers: {
|
|
39
40
|
'Content-Type': 'application/json',
|
|
40
41
|
'X-Client-Id': clientId
|
|
41
|
-
}
|
|
42
|
+
},
|
|
43
|
+
body: JSON.stringify(payload)
|
|
42
44
|
});
|
|
43
|
-
|
|
45
|
+
const data = await res.json();
|
|
46
|
+
return data;
|
|
44
47
|
}
|
|
45
48
|
catch (error) {
|
|
46
49
|
throw new Error("There is an error with sign up");
|
|
@@ -76,17 +79,17 @@ export async function FetchProfile(serverURL, clientId, token) {
|
|
|
76
79
|
throw new Error("All the fields are required");
|
|
77
80
|
}
|
|
78
81
|
try {
|
|
79
|
-
const
|
|
82
|
+
const url = `${serverURL}/api/flashauth/fetch/profile`;
|
|
83
|
+
const res = await fetch(url, {
|
|
84
|
+
method: 'GET',
|
|
80
85
|
headers: {
|
|
81
86
|
'Content-Type': 'application/json',
|
|
82
87
|
'X-Client-Id': clientId,
|
|
83
|
-
Authorization: `Bearer:${token}`
|
|
88
|
+
'Authorization': `Bearer:${token}`
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
return userResponse.data;
|
|
91
|
+
const data = await res.json();
|
|
92
|
+
return data.data;
|
|
90
93
|
}
|
|
91
94
|
catch (error) {
|
|
92
95
|
throw new Error("There is an error with Fetching user profile");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthManager.d.ts","sourceRoot":"","sources":["../../src/Managers/AuthManager.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,qBAAqB,CAAsB;gBAEvC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM;IAcxC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthManager.d.ts","sourceRoot":"","sources":["../../src/Managers/AuthManager.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,qBAAqB,CAAsB;gBAEvC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM;IAcxC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;CAuB5C"}
|
|
@@ -21,7 +21,6 @@ export default class AuthManager {
|
|
|
21
21
|
try {
|
|
22
22
|
const googleProvider = new GoogleAuthProvider();
|
|
23
23
|
const url = await googleProvider.GetLoginURL(this.ClientId, this.ServerURL);
|
|
24
|
-
console.log("O AUTH URL", url);
|
|
25
24
|
const popup = this.OAuthPopupManager.openPopupURL(url, "GoogleAuth", 500, 600);
|
|
26
25
|
if (!popup)
|
|
27
26
|
throw new Error("FlashAuth: Popup blocked by browser");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flashauthbyjagwar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "An authentication SDK for your React site. No need to write auth logic — just create an account at flashauth.connectjagwar.com to get started.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/jagwar7/flashauth-sdk#readme",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"axios": "^1.12.2",
|
|
43
42
|
"firebase": "^12.1.0",
|
|
44
43
|
"jwt-decode": "^4.0.0"
|
|
45
44
|
},
|