Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Aggiunta funzione per il test delle pagine view senza connessione all…
Browse files Browse the repository at this point in the history
…e API
  • Loading branch information
Maxelweb committed Mar 21, 2020
1 parent 699b0b4 commit 0ffa7b6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/Providers/UserServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function __construct()
* @return User|Authenticatable|null
*/
public function retrieveById($identifier){

try {

$response = json_decode($this->request->get('user/'.$identifier, [
Expand Down Expand Up @@ -76,6 +77,7 @@ public function updateRememberToken(Authenticatable $user, $token){
* @return User|Authenticatable|RedirectResponse
*/
public function retrieveByCredentials(array $credentials){

try {
if(key_exists('code', $credentials)){
$this->request = new Client([
Expand Down Expand Up @@ -150,4 +152,18 @@ public function findAll(){
abort($e->getCode(), $e->getResponse()->getReasonPhrase());
}
}

// ===================================================
// Mockup per un utente
// Funzione da rimuovere in production

public function ImJustAGuyDontBotherMe(){
$user = new User();
$arr = array_combine(array('userId','name', 'surname', 'email', 'type', 'telegramName', 'telegramChat', 'deleted', 'tfa', 'token'),
array("1", "sys", "admin", "sys@admin.it", "0", "pippo", "123", "0", "0", "456"));
$user->fill($arr);
return $user;
}


}

0 comments on commit 0ffa7b6

Please sign in to comment.