Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
Fixed response not returning the JSON content.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGhostHunter committed Jul 10, 2020
1 parent d1f49ac commit 6881d54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions resources/js/larapass.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ class Larapass
/**
* Handles the response from the Server.
*
* Throws the response if is not OK (HTTP 2XX).
* Throws the entire response if is not OK (HTTP 2XX).
*
* @param response {Response}
* @returns Response
* @returns Promise<any>
* @throws Response
*/
static #handleResponse(response)
{
if (response.ok) {
return response;
return response.json();
}

throw response;
Expand All @@ -251,7 +251,7 @@ class Larapass
*
* @param data {{string}}
* @param headers {{string}}
* @returns {Promise<Response>}
* @returns Promise<any>
*/
async login(data = {}, headers = {})
{
Expand All @@ -272,7 +272,7 @@ class Larapass
*
* @param data {{string}}
* @param headers {{string}}
* @returns {Promise<Response>}
* @returns Promise<any>
*/
async register(data = {}, headers = {})
{
Expand Down

0 comments on commit 6881d54

Please sign in to comment.