File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,28 +28,6 @@ export default class Auth {
2828 }
2929
3030 _processJWT ( promise , jwt ) {
31- return promise . then ( response => {
32- jwt = response . headers . get ( 'jwt' ) ;
33-
34- if ( response . status == 200 && jwt ) {
35- return response . json ( ) ;
36- }
37-
38- throw new Error ( 'Server error, try again later. Sorry for inconvenience :(' ) ;
39- } )
40- . then ( user => {
41- if ( user . email ) {
42- return {
43- user,
44- jwt,
45- } ;
46- }
47-
48- throw new Error ( 'Server error, try again later. Sorry for inconvenience :(' ) ;
49- } ) ;
50- }
51-
52- _processJWTinSignup ( promise , jwt ) {
5331 return promise . then ( response => {
5432 jwt = response . headers . get ( 'jwt' ) ;
5533 return response . json ( ) ;
@@ -86,7 +64,7 @@ export default class Auth {
8664 }
8765 ) ;
8866
89- return this . _processJWTinSignup ( signupPromise , jwt ) ;
67+ return this . _processJWT ( signupPromise , jwt ) ;
9068 }
9169
9270 // @method login(email: String, password: String, org: String): Promise<LoginResponse>
You can’t perform that action at this time.
0 commit comments