Use a middleware to define micropub dev token

This commit is contained in:
Jonny Barnes 2016-12-08 20:35:35 +00:00
parent 2814a39ad8
commit bce3b52ce2
4 changed files with 29 additions and 36 deletions

View file

@ -1,35 +0,0 @@
<?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 (config('app.env') !== 'production') {
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()
{
//
}
}