namespace BookStack\Users\Controllers;
-use BookStack\Access\SocialAuthService;
+use BookStack\Access\SocialDriverManager;
use BookStack\Http\Controller;
use BookStack\Permissions\PermissionApplicator;
use BookStack\Settings\UserNotificationPreferences;
) {
$this->middleware(function (Request $request, Closure $next) {
$this->preventGuestAccess();
- $this->preventAccessInDemoMode();
return $next($request);
});
}
*/
public function updateProfile(Request $request, ImageRepo $imageRepo)
{
+ $this->preventAccessInDemoMode();
+
$user = user();
$validated = $this->validate($request, [
'name' => ['min:2', 'max:100'],
*/
public function updateNotifications(Request $request)
{
+ $this->preventAccessInDemoMode();
$this->checkPermission('receive-notifications');
$data = $this->validate($request, [
'preferences' => ['required', 'array'],
/**
* Show the view for the "Access & Security" account options.
*/
- public function showAuth(SocialAuthService $socialAuthService)
+ public function showAuth(SocialDriverManager $socialDriverManager)
{
$mfaMethods = user()->mfaValues()->get()->groupBy('method');
'category' => 'auth',
'mfaMethods' => $mfaMethods,
'authMethod' => config('auth.method'),
- 'activeSocialDrivers' => $socialAuthService->getActiveDrivers(),
+ 'activeSocialDrivers' => $socialDriverManager->getActive(),
]);
}
*/
public function updatePassword(Request $request)
{
+ $this->preventAccessInDemoMode();
+
if (config('auth.method') !== 'standard') {
$this->showPermissionError();
}