update login response, able to get token
This commit is contained in:
parent
3f0678397a
commit
9bdfd329a2
3
.env
3
.env
|
@ -56,7 +56,7 @@ RNRPHDEV="https://unioilstationlocatorapi.lbteksystems.com/api/"
|
||||||
|
|
||||||
|
|
||||||
PASSPORT_ADMIN_CLIENT_ID=2
|
PASSPORT_ADMIN_CLIENT_ID=2
|
||||||
PASSPORT_ADMIN_CLIENT_SECRET=LmAfZ1tQ780pQNhdfhGhLI6slWHI1QQRtsvffiZS
|
PASSPORT_ADMIN_CLIENT_SECRET=fvv0uTTB5mKcxwuoanQRmly9dUqgadbyPNWdXlc1
|
||||||
|
|
||||||
M360_BROADCAST_URL=https://smsapi.mobile360.ph/v2/api/broadcast
|
M360_BROADCAST_URL=https://smsapi.mobile360.ph/v2/api/broadcast
|
||||||
M360_BROADCAST_USERNAME=unioil
|
M360_BROADCAST_USERNAME=unioil
|
||||||
|
@ -91,3 +91,4 @@ FRONT_END_URL="http://mobileinteglb-993304533.ap-southeast-1.elb.amazonaws.com"
|
||||||
|
|
||||||
#si_num
|
#si_num
|
||||||
SI_NUM_RANDOM=false
|
SI_NUM_RANDOM=false
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,14 @@ class UserController extends Controller
|
||||||
$result = app()->handle($request)->getContent();
|
$result = app()->handle($request)->getContent();
|
||||||
$result = json_decode($result);
|
$result = json_decode($result);
|
||||||
|
|
||||||
|
$success['admin'] = [
|
||||||
|
'name' => $admin[0]['firstname'] . ' ' . $admin[0]['lastname'],
|
||||||
|
'username' => $admin[0]['username'],
|
||||||
|
'email' => $admin[0]['email'],
|
||||||
|
'role' => $admin[0]['role'],
|
||||||
|
'uuid' => $admin[0]['admin_uuid'],
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
$success['token'] = $result->access_token;
|
$success['token'] = $result->access_token;
|
||||||
// $success['refresh_token'] = $result->refresh_token;
|
// $success['refresh_token'] = $result->refresh_token;
|
||||||
|
@ -204,9 +212,15 @@ class UserController extends Controller
|
||||||
return $this->format->unprocessableEntity("Your password is expired",$data);
|
return $this->format->unprocessableEntity("Your password is expired",$data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$success['prompt_password'] = 1;
|
$success['prompt_password'] = 1;
|
||||||
$success['admin_uuid'] = $admin[0]['admin_uuid'];
|
$success['admin_uuid'] = $admin[0]['admin_uuid'];
|
||||||
|
$success['admin'] = [
|
||||||
|
'name' => $admin[0]['firstname'] . ' ' . $admin[0]['lastname'],
|
||||||
|
'username' => $admin[0]['username'],
|
||||||
|
'email' => $admin[0]['email'],
|
||||||
|
'role' => $admin[0]['role'],
|
||||||
|
'uuid' => $admin[0]['admin_uuid'],
|
||||||
|
];
|
||||||
$message = 'User must change password';
|
$message = 'User must change password';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,4 +36,9 @@ return [
|
||||||
'secret' => env('STRIPE_SECRET'),
|
'secret' => env('STRIPE_SECRET'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'passport' => [
|
||||||
|
'password_client_id' => env('PASSWORD_CLIENT_ID'),
|
||||||
|
'password_client_secret' => env('PASSWORD_CLIENT_SECRET'),
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('oauth_auth_codes', function (Blueprint $table) {
|
||||||
|
$table->string('id', 100)->primary();
|
||||||
|
$table->unsignedBigInteger('user_id')->index();
|
||||||
|
$table->unsignedBigInteger('client_id');
|
||||||
|
$table->text('scopes')->nullable();
|
||||||
|
$table->boolean('revoked');
|
||||||
|
$table->dateTime('expires_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('oauth_auth_codes');
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('oauth_access_tokens', function (Blueprint $table) {
|
||||||
|
$table->string('id', 100)->primary();
|
||||||
|
$table->unsignedBigInteger('user_id')->nullable()->index();
|
||||||
|
$table->unsignedBigInteger('client_id');
|
||||||
|
$table->string('name')->nullable();
|
||||||
|
$table->text('scopes')->nullable();
|
||||||
|
$table->boolean('revoked');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->dateTime('expires_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('oauth_access_tokens');
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
|
||||||
|
$table->string('id', 100)->primary();
|
||||||
|
$table->string('access_token_id', 100)->index();
|
||||||
|
$table->boolean('revoked');
|
||||||
|
$table->dateTime('expires_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('oauth_refresh_tokens');
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('oauth_clients', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->unsignedBigInteger('user_id')->nullable()->index();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('secret', 100)->nullable();
|
||||||
|
$table->string('provider')->nullable();
|
||||||
|
$table->text('redirect');
|
||||||
|
$table->boolean('personal_access_client');
|
||||||
|
$table->boolean('password_client');
|
||||||
|
$table->boolean('revoked');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('oauth_clients');
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->unsignedBigInteger('client_id');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('oauth_personal_access_clients');
|
||||||
|
}
|
||||||
|
};
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use App\Http\Controllers\API\AdminController;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -21,6 +22,7 @@ Route::post('cms/login_changePassword', 'API\UserController@cms_changePassword')
|
||||||
Route::post('cms/checkTime', 'API\UserController@checkTime');
|
Route::post('cms/checkTime', 'API\UserController@checkTime');
|
||||||
Route::get('cms/convertmd5', 'API\UserController@convertmd5');
|
Route::get('cms/convertmd5', 'API\UserController@convertmd5');
|
||||||
|
|
||||||
|
|
||||||
Route::get('cms/systemPreference', 'API\SystemPreferenceController@index');
|
Route::get('cms/systemPreference', 'API\SystemPreferenceController@index');
|
||||||
Route::get('cms/systemPreference/{id}', 'API\SystemPreferenceController@show');
|
Route::get('cms/systemPreference/{id}', 'API\SystemPreferenceController@show');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue