mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Logout Controller
This commit is contained in:
parent
48da709d6e
commit
b0f5ca8638
@ -59,12 +59,14 @@ class LogoutController extends BaseController
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
CompanyToken::whereRaw('BINARY `token`= ?', [$request->header('X-API-TOKEN')])
|
||||
CompanyToken::with('company')
|
||||
->whereRaw('BINARY `token`= ?', [$request->header('X-API-TOKEN')])
|
||||
->company
|
||||
->tokens()
|
||||
->where('is_system', true)
|
||||
->forceDelete();
|
||||
|
||||
return response()->json(['message' => 'logged out.'], 200);
|
||||
return response()->json(['message' => 'All tokens deleted'], 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -295,6 +295,7 @@ class MultiDB
|
||||
/* This will set the database connection for the request */
|
||||
config(['database.default' => $database]);
|
||||
|
||||
// for some reason this breaks everything _hard_
|
||||
// DB::purge($database);
|
||||
// DB::reconnect($database);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user