File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,11 +124,20 @@ class StorytelClient {
124124 }
125125
126126 async login ( email : string , password : string ) : Promise < LoginData > {
127- const encryptedPassword = encryptPassword ( password . trim ( ) ) ;
128- const url = `https://www.storytel.com/api/login.action?m=1&uid=${ email . trim ( ) } &pwd=${ encryptedPassword } ` ;
127+ const trimmedEmail = email . trim ( ) ;
128+ const trimmedPassword = password . trim ( ) ;
129+ const encryptedPassword = encryptPassword ( trimmedPassword ) ;
130+ const url = "https://www.storytel.com/api/login.action" ;
131+ const params = {
132+ m : 1 ,
133+ uid : trimmedEmail ,
134+ pwd : encryptedPassword ,
135+ } ;
129136
130137 try {
131- const response = await this . client . get < LoginData > ( url ) ;
138+ const response = await this . client . get < LoginData > ( url , {
139+ params,
140+ } ) ;
132141 this . loginData = response . data ;
133142 return this . loginData ;
134143 } catch ( error : any ) {
You can’t perform that action at this time.
0 commit comments