mirror of
https://github.com/koel/koel
synced 2024-11-28 15:00:42 +00:00
Merge branch 'master' into compilation
This commit is contained in:
commit
22b228f338
5 changed files with 11 additions and 10 deletions
|
@ -19,7 +19,7 @@ class Application extends IlluminateApplication
|
|||
*
|
||||
* @link https://github.com/phanan/koel/releases
|
||||
*/
|
||||
const VERSION = 'v2.3.0';
|
||||
const VERSION = 'v2.2.1';
|
||||
|
||||
/**
|
||||
* We have merged public path and base path.
|
||||
|
|
|
@ -7,6 +7,7 @@ use App\Http\Requests\API\UserLoginRequest;
|
|||
use App\Http\Requests\API\UserStoreRequest;
|
||||
use App\Http\Requests\API\UserUpdateRequest;
|
||||
use App\Models\User;
|
||||
use Exception;
|
||||
use Hash;
|
||||
use JWTAuth;
|
||||
use Log;
|
||||
|
@ -43,12 +44,12 @@ class UserController extends Controller
|
|||
*/
|
||||
public function logout()
|
||||
{
|
||||
try {
|
||||
JWTAuth::invalidate(JWTAuth::getToken());
|
||||
} catch (JWTException $e) {
|
||||
Log:error($e);
|
||||
|
||||
return response()->json(['error' => 'could_not_invalidate_token'], 500);
|
||||
if ($token = JWTAuth::getToken()) {
|
||||
try {
|
||||
JWTAuth::invalidate($token);
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json();
|
||||
|
|
|
@ -12,6 +12,7 @@ Route::get('/♫', function () {
|
|||
Route::group(['prefix' => 'api', 'namespace' => 'API'], function () {
|
||||
|
||||
Route::post('me', 'UserController@login');
|
||||
Route::delete('me', 'UserController@logout');
|
||||
|
||||
Route::group(['middleware' => 'jwt.auth'], function () {
|
||||
Route::get('/', function () {
|
||||
|
@ -40,7 +41,6 @@ Route::group(['prefix' => 'api', 'namespace' => 'API'], function () {
|
|||
|
||||
Route::resource('user', 'UserController', ['only' => ['store', 'update', 'destroy']]);
|
||||
Route::put('me', 'UserController@updateProfile');
|
||||
Route::delete('me', 'UserController@logout');
|
||||
|
||||
Route::get('lastfm/connect', 'LastfmController@connect');
|
||||
Route::post('lastfm/session-key', 'LastfmController@setSessionKey');
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"mocha": "^2.3.4",
|
||||
"node-sass": "^3.4.2",
|
||||
"nprogress": "^0.2.0",
|
||||
"plyr": "^1.5.16",
|
||||
"plyr": "1.5.x",
|
||||
"rangeslider.js": "^2.1.1",
|
||||
"rangetouch": "0.0.9",
|
||||
"sinon": "^1.17.2",
|
||||
|
|
|
@ -22,7 +22,7 @@ Vue.http.interceptors.push({
|
|||
NProgress.done();
|
||||
|
||||
if (r.status === 400 || r.status === 401) {
|
||||
if (r.request.method !== 'POST' && r.request.url !== 'me') {
|
||||
if (!(r.request.method === 'POST' && r.request.url === 'me')) {
|
||||
// This is not a failed login. Log out then.
|
||||
app.logout();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue