OPATUT, WE WENT OVER THIS. EXPANDTAB.

This commit is contained in:
Kekskurse 2019-07-17 14:52:22 +02:00
parent 80e4a6a060
commit d13b2f870a
2 changed files with 16 additions and 4 deletions

View file

@ -27,6 +27,10 @@ class oAuthController extends Controller
}
public function authorizeView(Request $request) {
if(getenv("NEW_GUI")){
$guiURL = getenv("GUI_URL")."/#/oauth?".$_SERVER['QUERY_STRING'];
return redirect($guiURL);
}
$app = App::query()->where("apiKey", "=", $request->input("client_id"))->first();
$user = Auth::user();
$redirect = false;

View file

@ -6,6 +6,7 @@ use App\Models\AccessToken;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
class AuthServiceProvider extends ServiceProvider
@ -65,7 +66,7 @@ class AuthServiceProvider extends ServiceProvider
if(isset($_GET["token"])) {
$token = $_GET["token"];
}
Log::debug("Request Header", getallheaders());
if(!is_null($request)) {
if($request->header("Authorization", false)) {
$token = trim($request->header("Authorization"));
@ -74,9 +75,16 @@ class AuthServiceProvider extends ServiceProvider
}
} else {
$headers = getallheaders();
$token = trim($headers["Authorization"]);
$t = explode(" ", $token);
$token = last($t);
if(isset($headers["Authorization"])) {
$token = trim($headers["Authorization"]);
$t = explode(" ", $token);
$token = last($t);
}
if(isset($headers["authorization"])) {
$token = trim($headers["authorization"]);
$t = explode(" ", $token);
$token = last($t);
}
}