@@ -25,9 +25,9 @@ type CurrentUserResponse struct {
2525}
2626
2727func FetchAccessToken () (* LoginResponse , error ) {
28- api_url := viper .GetString ("api_url" )
28+ apiURL := viper .GetString ("api_url" )
2929 client := & http.Client {}
30- r , err := http .NewRequest ("POST" , api_url + "/v1/auth/refresh" , bytes .NewBuffer ([]byte {}))
30+ r , err := http .NewRequest ("POST" , apiURL + "/v1/auth/refresh" , bytes .NewBuffer ([]byte {}))
3131 r .Header .Add ("X-Refresh-Token" , viper .GetString ("refresh_token" ))
3232 if err != nil {
3333 return nil , err
@@ -53,13 +53,13 @@ func FetchAccessToken() (*LoginResponse, error) {
5353}
5454
5555func LoginWithCode (code string ) (* LoginResponse , error ) {
56- api_url := viper .GetString ("api_url" )
56+ apiURL := viper .GetString ("api_url" )
5757 req , err := json .Marshal (LoginRequest {Otp : code })
5858 if err != nil {
5959 return nil , err
6060 }
6161
62- resp , err := http .Post (api_url + "/v1/auth/otp/login" , "application/json" , bytes .NewReader (req ))
62+ resp , err := http .Post (apiURL + "/v1/auth/otp/login" , "application/json" , bytes .NewReader (req ))
6363 if err != nil {
6464 return nil , err
6565 }
@@ -116,9 +116,9 @@ func fetchWithAuth(method string, url string) ([]byte, error) {
116116}
117117
118118func fetchWithAuthAndPayload (method string , url string , payload []byte ) ([]byte , int , error ) {
119- api_url := viper .GetString ("api_url" )
119+ apiURL := viper .GetString ("api_url" )
120120 client := & http.Client {}
121- r , err := http .NewRequest (method , api_url + url , bytes .NewBuffer (payload ))
121+ r , err := http .NewRequest (method , apiURL + url , bytes .NewBuffer (payload ))
122122 if err != nil {
123123 return nil , 0 , err
124124 }
0 commit comments