glitch-javascript-sdk 0.3.7 → 0.3.8
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/cjs/index.js +4 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Auth.d.ts +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/util/Session.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/api/Auth.ts +2 -2
- package/src/util/Session.ts +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ declare class Auth {
|
|
|
97
97
|
*
|
|
98
98
|
* @returns promise
|
|
99
99
|
*/
|
|
100
|
-
static oneTimeLogin<T>(): AxiosPromise<Response<T>>;
|
|
100
|
+
static oneTimeLogin<T>(token: string): AxiosPromise<Response<T>>;
|
|
101
101
|
/**
|
|
102
102
|
* Execute the password reset process using a user's email address.
|
|
103
103
|
*
|
|
@@ -1692,6 +1692,7 @@ declare class Session {
|
|
|
1692
1692
|
first_name: string;
|
|
1693
1693
|
last_name: string;
|
|
1694
1694
|
email: string;
|
|
1695
|
+
username: string;
|
|
1695
1696
|
}): void;
|
|
1696
1697
|
}
|
|
1697
1698
|
|
package/package.json
CHANGED
package/src/api/Auth.ts
CHANGED
|
@@ -53,8 +53,8 @@ class Auth {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns promise
|
|
55
55
|
*/
|
|
56
|
-
public static oneTimeLogin<T>() : AxiosPromise<Response<T>> {
|
|
57
|
-
return Requests.processRoute(AuthRoutes.routes.one_time_login, {});
|
|
56
|
+
public static oneTimeLogin<T>(token : string) : AxiosPromise<Response<T>> {
|
|
57
|
+
return Requests.processRoute(AuthRoutes.routes.one_time_login, {token : token});
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
package/src/util/Session.ts
CHANGED
|
@@ -40,13 +40,15 @@ class Session {
|
|
|
40
40
|
Storage.set(Session._first_name_key, null);
|
|
41
41
|
Storage.set(Session._last_name_key, null);
|
|
42
42
|
Storage.set(Session._email_key, null);
|
|
43
|
+
Storage.set(Session._username_key, null);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
public static processAuthentication(data: { token: { access_token: string }, id: string, first_name: string, last_name: string, email: string }): void {
|
|
46
|
+
public static processAuthentication(data: { token: { access_token: string }, id: string, first_name: string, last_name: string, email: string, username: string }): void {
|
|
46
47
|
Storage.setAuthToken(data.token.access_token);
|
|
47
48
|
Storage.set(Session._id_key, data.id);
|
|
48
49
|
Storage.set(Session._first_name_key, data.first_name);
|
|
49
50
|
Storage.set(Session._last_name_key, data.last_name);
|
|
51
|
+
Storage.set(Session._username_key, data.username);
|
|
50
52
|
Storage.set(Session._email_key, data.email);
|
|
51
53
|
|
|
52
54
|
Config.setAuthToken(data.token.access_token);
|