Move micropub session stuff to its own service provider
This commit is contained in:
parent
cd324f72d5
commit
e32cc59b81
3 changed files with 36 additions and 9 deletions
35
app/Providers/MicropubSessionProvider.php
Normal file
35
app/Providers/MicropubSessionProvider.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class MicropubSessionProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//allow micropub use in development
|
||||
if (env('APP_DEBUG') == true) {
|
||||
session(['me' => env('APP_URL')]);
|
||||
if (Storage::exists('dev-token')) {
|
||||
session(['token' => Storage::get('dev-token')]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue