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.
@@ -19,6 +19,7 @@ declare class Session {
19
19
  first_name: string;
20
20
  last_name: string;
21
21
  email: string;
22
+ username: string;
22
23
  }): void;
23
24
  }
24
25
  export default Session;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
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
  /**
@@ -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);