Giter Site home page Giter Site logo

rinvex / laravel-auth Goto Github PK

View Code? Open in Web Editor NEW
133.0 13.0 12.0 1.97 MB

A powerful authentication, authorization and verification package built on top of Laravel. It provides developers with Role Based Access Control, Two-Factor Authentication, Social Authentication, and much more, compatible Laravel’s standard API and fully featured out of the box.

Home Page: https://rinvex.com

License: MIT License

PHP 100.00%
php laravel authentication authorization roles abilities permissions two-factor-authentication

laravel-auth's Introduction

Rinvex Auth

Rinvex Auth is a powerful authentication, authorization and verification package built on top of Laravel. It provides developers with Role Based Access Control, TwoFactor Authentication, Social Authentication, compatible with Laravel’s standard API and fully featured all-in-one solution out of the box.

Packagist Scrutinizer Code Quality Travis StyleCI License

Notice

Documentation to be written!

This package usually used with rinvex/cortex, so it may not be that useful alone or outside that application layer.

Changelog

Refer to the Changelog for a full history of the project.

Support

The following support channels are available at your fingertips:

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.

Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License

This software is released under The MIT License (MIT).

(c) 2016-2022 Rinvex LLC, Some rights reserved.

laravel-auth's People

Contributors

dependabot-preview[bot] avatar emahuni avatar mohamed-hendawy avatar noxify avatar omranic avatar rattone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-auth's Issues

Your email already verified!

These exception happens in specific scenario
steps:
1- register new user
2- chose login from top menu
3- enter already registered user login credentials
this will throw exception

(1/1) ExceptionYour email already verified!

in EmailVerificationRequest.php (line 26)
at EmailVerificationRequest->authorize()
at call_user_func_array(array(object(EmailVerificationRequest), 'authorize'), array())in BoundMethod.php (line 29)
at BoundMethod::Illuminate\Container{closure}()in BoundMethod.php (line 87)
at BoundMethod::callBoundMethod(object(Application), array(object(EmailVerificationRequest), 'authorize'), object(Closure))in BoundMethod.php (line 31)
at BoundMethod::call(object(Application), array(object(EmailVerificationRequest), 'authorize'), array(), null)in Container.php (line 539)
at Container->call(array(object(EmailVerificationRequest), 'authorize'))in FormRequest.php (line 186)
at FormRequest->passesAuthorization()in ValidatesWhenResolvedTrait.php (line 21)
at FormRequest->validate()in FormRequestServiceProvider.php (line 31)
at FormRequestServiceProvider->Illuminate\Foundation\Providers{closure}(object(EmailVerificationRequest), object(Application))in Container.php (line 1019)
at Container->fireCallbackArray(object(EmailVerificationRequest), array(object(Closure)))in Container.php (line 983)
at Container->fireAfterResolvingCallbacks('App\Http\Requests\Frontend\EmailVerificationRequest', object(EmailVerificationRequest))in Container.php (line 968)
at Container->fireResolvingCallbacks('App\Http\Requests\Frontend\EmailVerificationRequest', object(EmailVerificationRequest))in Container.php (line 627)
at Container->resolve('App\Http\Requests\Frontend\EmailVerificationRequest')in Container.php (line 575)
at Container->make('App\Http\Requests\Frontend\EmailVerificationRequest')in Application.php (line 728)
at Application->make('App\Http\Requests\Frontend\EmailVerificationRequest')in RouteDependencyResolverTrait.php (line 77)
at ControllerDispatcher->transformDependency(object(ReflectionParameter), array())in RouteDependencyResolverTrait.php (line 45)
at ControllerDispatcher->resolveMethodDependencies(array(), object(ReflectionMethod))in RouteDependencyResolverTrait.php (line 27)
at ControllerDispatcher->resolveClassMethodDependencies(array(), object(EmailVerificationController), 'request')in ControllerDispatcher.php (line 40)
at ControllerDispatcher->dispatch(object(Route), object(EmailVerificationController), 'request')in Route.php (line 203)
at Route->runController()in Route.php (line 160)
at Route->run()in Router.php (line 574)
at Router->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in NoHttpCache.php (line 23)
at NoHttpCache->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in UpdateLastActivity.php (line 23)
at UpdateLastActivity->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Abilities.php (line 38)
at Abilities->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in SubstituteBindings.php (line 41)
at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in VerifyCsrfToken.php (line 65)
at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ShareErrorsFromSession.php (line 49)
at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in StartSession.php (line 64)
at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37)
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in EncryptCookies.php (line 59)
at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Router.php (line 576)
at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 535)
at Router->dispatchToRoute(object(Request))in Router.php (line 513)
at Router->dispatch(object(Request))in Kernel.php (line 176)
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ValidatePostSize.php (line 27)
at ValidatePostSize->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForMaintenanceMode.php (line 46)
at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Kernel.php (line 151)
at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116)
at Kernel->handle(object(Request))in index.php (line 53)
at require_once('/home/savvy/Code/testFort/public/index.php')in server.php (line 21)

How to use Middleware in custom routes

Hi,

I have installed the latest version from the fort package.
To keep it as simple as possible, i installed also infyomlabs/laravel-generator.

Everything works fine, I can see the data etc.

But when i run php artisan route:list i see a difference between my own routes and your package routes...

Here is the current result:
https://gist.github.com/noxify/695eb23e7c4e25de4e78b826d4b71288

My routes file is the following: (/routes/web.backend.php)
https://gist.github.com/noxify/b784473f8bab84d3b74b7a4eec6683d2

The app\Provider\RouteServiceProvider.php is the following:

<?php

namespace App\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * This namespace is applied to your controller routes.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = 'App\Http\Controllers';

    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @return void
     */
    public function boot()
    {
        //

        parent::boot();
    }

    /**
     * Define the routes for the application.
     *
     * @return void
     */
    public function map()
    {
        $this->mapApiRoutes();

        $this->mapWebRoutes();

        //
    }

    /**
     * Define the "web" routes for the application.
     *
     * These routes all receive session state, CSRF protection, etc.
     *
     * @return void
     */
    protected function mapWebRoutes()
    {
        Route::group([
            'middleware' => 'web',
            'namespace' => $this->namespace,
        ], function ($router) {
            require base_path('routes/web.php');
	        require base_path('routes/web.backend.php');
        });
    }

    /**
     * Define the "api" routes for the application.
     *
     * These routes are typically stateless.
     *
     * @return void
     */
    protected function mapApiRoutes()
    {
        Route::group([
            'middleware' => 'api',
            'namespace' => $this->namespace,
            'prefix' => 'api',
        ], function ($router) {
            require base_path('routes/api.php');
        });
    }
}

Example Admin Controller:
https://gist.github.com/noxify/57441dff458f45cdcb3aac499dc30573

Any idea how can I enable the automatic generation from the middleware like your package it does?

Thanks!

Missing Methods in GenericHandler

Hi,

while testing the registration, I found some missing methods inside the GenericHandler.

  • authUnverified
  • twoFactorRequired
  • registerStart
  • registerSocialStart
  • passwordResetStart
  • passwordResetSuccess
  • emailVerificationStart

In my case, the error message is/was:

call_user_func_array() expects parameter 1 to be a valid callback, class 'Rinvex\Fort\Handlers\GenericHandler' does not have a method 'registerStart'

Google+ Social Auth Problem

Hi,

while trying to implement the social auth for google I got the following error message:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'provider_uid' at row 1 (SQL: insert into `rinvex_fort_socialites` (`user_id`, `provider`, `provider_uid`, `updated_at`, `created_at`) values (3, google, 117909847557586478307, 2017-01-22 18:01:19, 2017-01-22 18:01:19))

Tested with the current dev version.

I have checked the migration file, and the provider_uid is defined with 10.
It seems that we have to change the length for this field to 21 or more.

My Controller Code:

	/**
	 * Redirect to Google for authentication.
	 *
	 * @return \Illuminate\Http\Response
	 */
	public function redirectToGoogle()
	{
		return Socialite::driver('google')->redirect();
	}

	/**
	 * Handle Google authentication callback.
	 *
	 * @param \Illuminate\Http\Request $request
	 * @param \Rinvex\Fort\Models\User $user
	 *
	 * @return \Illuminate\Http\Response
	 */
	public function handleGoogleCallback(Request $request, User $user)
	{
		try {
			$googleUser = Socialite::driver('google')->user();
		} catch (Exception $e) {
			return intend([
				'route' => 'rinvex.fort.frontend.auth.social.google',
			]);
		}
		
		$model = User::whereHas('socialites', function ($query) use ($googleUser) {
			$query->where('provider', 'google');
			$query->where('provider_uid', $googleUser->id);
		})->first();
		
		if (!$model) {
			
			// Prepare registration data
			$input = [
				'email'    => $googleUser->email,
				'username' => $googleUser->nickname,
				'password' => str_random(),
				'active'   => ! config('rinvex.fort.registration.moderated'),
			];
			
			// Fire the register start event
			$result = event('rinvex.fort.register.social.start', [$input]);
			
			// Create user
			$model = $user->create($input);
			
			// Fire the register success event
			event('rinvex.fort.register.social.success', $model);
			
			$model->socialites()->create([
				'user_id'      => 'google',
				'provider'     => 'google',
				'provider_uid' => $googleUser->id,
			]);
		}
		
		$result = Auth::guard($this->getGuard())->login($model, true);
		
		return $this->getLoginResponse($request, $result);
	}

Routes:

	    Route::get('google')->name('social.google')->uses('SocialAuthenticationController@redirectToGoogle');
	    Route::get('google/callback')->name('social.google.callback')->uses('SocialAuthenticationController@handleGoogleCallback');

@Omranic - if you want, feel free to use this code to support google social auth by default :)

FatalThrowableError in FortEventListener.php line 1029:

Hi,

while playing a bit around with the package, i tried to kill all my existing sessions.

The result is:

Type error: Argument 2 passed to Rinvex\Fort\Listeners\FortEventListener::persistenceDeleting() must be an instance of Rinvex\Fort\Models\Persistence, instance of Rinvex\Fort\Models\User given

composer.json require part:

"require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "barryvdh/laravel-debugbar": "V2.2.3",
        "rinvex/fort": "dev-master",
        "laravelcollective/html": "5.3.x-dev"
    },

Here the trace:

in FortEventListener.php line 1029
at FortEventListener->persistenceDeleting(object(PersistenceRepository), object(User))
at call_user_func_array(array(object(FortEventListener), 'persistenceDeleting'), array(object(PersistenceRepository), object(User))) in Dispatcher.php line 348
at Dispatcher->Illuminate\Events\{closure}(object(PersistenceRepository), object(User))
at call_user_func_array(object(Closure), array(object(PersistenceRepository), object(User))) in Dispatcher.php line 221
at Dispatcher->fire('rinvex.fort.persistence.entity.deleting', array(object(PersistenceRepository), object(User))) in PersistenceRepository.php line 69
at PersistenceRepository->deleteByUser('1') in UserSessionsController.php line 48
at UserSessionsController->flush(object(Request))
at call_user_func_array(array(object(UserSessionsController), 'flush'), array(object(Request))) in Controller.php line 55
at Controller->callAction('flush', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(UserSessionsController), 'flush') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 642
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 41
at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 49
at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53

Creating default object from empty value || Class App\Http\Controllers\Frontend\EmailVerificationSendRequest does not exist

Request Email Verification
when entering a 'not verified email' and click on 'Request Email Verification' these exceptions appears.

The second exception happens whenever any exception that doesn't create user happens
ex: if there is error in sending registration verification email, registration process stops so the second exception appeared.

1

(1/1) ReflectionExceptionClass App\Http\Controllers\Frontend\EmailVerificationSendRequest does not exist

in RouteSignatureParameters.php (line 25)
at ReflectionParameter->getClass()in RouteSignatureParameters.php (line 25)
at RouteSignatureParameters::Illuminate\Routing{closure}(object(ReflectionParameter))
at array_filter(array(object(ReflectionParameter)), object(Closure))in RouteSignatureParameters.php (line 26)
at RouteSignatureParameters::fromAction(array('middleware' => array('web', 'web', 'nohttpcache'), 'uses' => 'App\Http\Controllers\Frontend\EmailVerificationController@send', 'as' => 'frontend.verification.email.send', 'namespace' => 'App\Http\Controllers\Frontend', 'prefix' => 'verification/email', 'where' => array(), 'controller' => 'App\Http\Controllers\Frontend\EmailVerificationController@send'), 'Illuminate\Database\Eloquent\Model')in Route.php (line 425)
at Route->signatureParameters('Illuminate\Database\Eloquent\Model')in ImplicitRouteBinding.php (line 20)
at ImplicitRouteBinding::resolveForRoute(object(Application), object(Route))in Router.php (line 648)
at Router->substituteImplicitBindings(object(Route))in SubstituteBindings.php (line 39)
at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in VerifyCsrfToken.php (line 65)
at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ShareErrorsFromSession.php (line 49)
at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in StartSession.php (line 64)
at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37)
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in EncryptCookies.php (line 59)
at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Router.php (line 576)
at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 535)
at Router->dispatchToRoute(object(Request))in Router.php (line 513)
at Router->dispatch(object(Request))in Kernel.php (line 176)
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ValidatePostSize.php (line 27)
at ValidatePostSize->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForMaintenanceMode.php (line 46)
at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Kernel.php (line 151)
at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116)
at Kernel->handle(object(Request))in index.php (line 53)
at require_once('/home/savvy/Code/testFort/public/index.php')in server.php (line 21)

(1/1) ErrorExceptionCreating default object from empty value

in UpdateLastActivity.php (line 37)
at HandleExceptions->handleError(2, 'Creating default object from empty value', '/home/savvy/Code/testFort/vendor/rinvex/fort/src/Http/Middleware/UpdateLastActivity.php', 37, array('request' => object(Request), 'response' =>object(Response), 'user' => object(stdClass)))in UpdateLastActivity.php (line 37)
at UpdateLastActivity->terminate(object(Request), object(Response))in Kernel.php (line 218)
at Kernel->terminateMiddleware(object(Request), object(Response))in Kernel.php (line 189)
at Kernel->terminate(object(Request), object(Response))in index.php (line 58)
at require_once('/home/savvy/Code/testFort/public/index.php')in server.php (line 21)

FatalThrowableError in Handler.php line 72: Class 'App\Exceptions\Lang' not found

This error happens on original Laravel Handler.php file if the developer doesn't put it when installing the package (this is also IDE dependent to note that an import is missing). I think it should be stated in the documentation that the following line should be added on top of the Handler.php file:

    use Illuminate\Support\Facades\Lang;

Failed - validation

I have many problems with validation in code

$user = [
'username' => 'admin',
'email' => '[email protected]',
'email_verified' => true,
'email_verified_at' => \Carbon::now(),
'remember_token' => str_random(10),
'password' => \Hash::make('123'),
'active' => true,
];

\Rinvex\Fort\Models\User::create($user);

Error returned "The given data failed to pass validation"

But if using the code works correctly

$user = [
'username' => 'admin',
'email' => '[email protected]',
'email_verified' => true,
'email_verified_at' => \Carbon::now(),
'remember_token' => str_random(10),
'password' => \Hash::make('123'),
'active' => true,
];

$temp = new \Rinvex\Fort\Models\User();
foreach ($user as $key => $value) {
$temp->$key = $value;
}
$temp->forceSave();

I can not find where it is generating this problem

GitHub Social Login

I installed this package on a fresh Laravel install to try it out for a project today, and have a problem or two.

When I try to login using GitHub it does not create a new user, but instead logs me in as only user in the db – the admin.

I do get authenticated with GitHub, and get redirected back to the local web site, which also retrieves the users information.

A dump of the $githubUser at /Http/Controllers/Frontend/SocialAuthenticationController.php#L47 does contain a valid user data record from GitHub.

Unfortunately, the DB request /Http/Controllers/Frontend/SocialAuthenticationController.php#L54 returns a user for some reason. I do not see the ‘whereHas’ being executed in the query.

$user = app('rinvex.fort.user')->whereHas('socialites', function ($query) use ($githubUser) {
    $query->where('provider', 'github')->where('provider_uid', $githubUser->id);
})->first();

Here is the SQL dump from that query.

array:4 [
  0 => array:3 [
    "query" => "select * from `rinvex_fort_users` where `rinvex_fort_users`.`deleted_at` is null limit 1"
    "bindings" => []
    "time" => 0.65
  ]
  1 => array:3 [
    "query" => "select `rinvex_fort_abilities`.*, `rinvex_fort_ability_user`.`user_id` as `pivot_user_id`, `rinvex_fort_ability_user`.`ability_id` as `pivot_ability_id`, `rinvex_fort_ability_user`.`created_at` as `pivot_created_at`, `rinvex_fort_ability_user`.`updated_at` as `pivot_updated_at` from `rinvex_fort_abilities` inner join `rinvex_fort_ability_user` on `rinvex_fort_abilities`.`id` = `rinvex_fort_ability_user`.`ability_id` where `rinvex_fort_ability_user`.`user_id` in (?) and `rinvex_fort_abilities`.`deleted_at` is null"
    "bindings" => array:1 [
      0 => 1
    ]
    "time" => 0.64
  ]
  2 => array:3 [
    "query" => "select `rinvex_fort_roles`.*, `rinvex_fort_role_user`.`user_id` as `pivot_user_id`, `rinvex_fort_role_user`.`role_id` as `pivot_role_id`, `rinvex_fort_role_user`.`created_at` as `pivot_created_at`, `rinvex_fort_role_user`.`updated_at` as `pivot_updated_at` from `rinvex_fort_roles` inner join `rinvex_fort_role_user` on `rinvex_fort_roles`.`id` = `rinvex_fort_role_user`.`role_id` where `rinvex_fort_role_user`.`user_id` in (?) and `rinvex_fort_roles`.`deleted_at` is null"
    "bindings" => array:1 [
      0 => 1
    ]
    "time" => 0.58
  ]
  3 => array:3 [
    "query" => "select `rinvex_fort_abilities`.*, `rinvex_fort_ability_role`.`role_id` as `pivot_role_id`, `rinvex_fort_ability_role`.`ability_id` as `pivot_ability_id`, `rinvex_fort_ability_role`.`created_at` as `pivot_created_at`, `rinvex_fort_ability_role`.`updated_at` as `pivot_updated_at` from `rinvex_fort_abilities` inner join `rinvex_fort_ability_role` on `rinvex_fort_abilities`.`id` = `rinvex_fort_ability_role`.`ability_id` where `rinvex_fort_ability_role`.`role_id` in (?) and `rinvex_fort_abilities`.`deleted_at` is null"
    "bindings" => array:1 [
      0 => 1
    ]
    "time" => 0.62
  ]
]

Any ideas?

Feature Request: Additional security checks for certain resources ( aka websudo )

The Idea (pasted from Slack)

I'm using the the two factor auth via app, everything is working fine in the frontend.
Now I had the idea to secure the backend/admin with the following:

  • Check that the user has the permission to see the dashboard / access to the backend
  • Check that the user has two factor enabled
  • User has to type a generated code from the app again

In confluence/jira and/or github there is something simular, but they require (only) the user password again.

Current Implementation

User Access a resource 
--> Middleware checks that the user is logged in
--> If defined, check also defined permissions (example via routes: `->middleware(['web', 'can:access-dashboard'])`)
--> All checks passed?
=> Yes: show requested resource
=> No: Show error message and redirect back

Future Implementation

User Access a resource 
--> Middleware checks that the user is logged in
--> If defined, check also defined permissions (example via routes: `->middleware(['web', 'can:access-dashboard'])`)
--> All checks passed?
--> security check defined?
---> Check which kind of security check is required
----> Password: Show additional form, where the user has to type the password again
----> 2FA: Show additional form, where the user has to type the 2FA token from the app/sms 
=> Yes: show requested resource
=> No: Show error message and redirect back

Both described implementations are simplified

How can we implement it

Via Guard / Middleware

I had the idea to create my own Guard (for example: admin guard).
Each route which should handled via the admin guard, will have a custom middleware.

Example:

`->middleware(['web', 'admin', 'can:access-dashboard'])`)

The idea was to use the existing functionality to keep the code maintainable (don't repeat yourself ;) )
This means, we can define it in the routes for each resource or via the controller "globally" for all resource actions.

Via Policy

While writing the Via Guard section, i have checked the policy documentation.
The idea here is to define, what we need in the policies.

Why? In the current implementation we have already the definitions for the resources and actions.

Example:

|        | GET|HEAD  | backend                            | rinvex.fort.backend.dashboard.home                 | Rinvex\Fort\Http\Controllers\Backend\DashboardController@home                             | web,can:access-dashboard,auth,can:access-dashboard,dashboard |
|        | GET|HEAD  | backend/abilities                  | rinvex.fort.backend.abilities.index                | Rinvex\Fort\Http\Controllers\Backend\AbilitiesController@index                            | web,can:access-dashboard,auth,can:list-abilities,abilities   |
|        | GET|HEAD  | backend/abilities/create           | rinvex.fort.backend.abilities.create               | Rinvex\Fort\Http\Controllers\Backend\AbilitiesController@create                           | web,can:access-dashboard,auth,can:create-abilities,abilities |
|        | POST      | backend/abilities/create           | rinvex.fort.backend.abilities.store                | Rinvex\Fort\Http\Controllers\Backend\AbilitiesController@store                            | web,can:access-dashboard,auth,can:create-abilities,abilities |
|        | GET|HEAD  | backend/abilities/{ability}        | rinvex.fort.backend.abilities.edit                 | Rinvex\Fort\Http\Controllers\Backend\AbilitiesController@edit                             | web,can:access-dashboard,auth,can:update-abilities,abilities |
|        | PUT       | backend/abilities/{ability}        | rinvex.fort.backend.abilities.update               | Rinvex\Fort\Http\Controllers\Backend\AbilitiesController@update                           | web,can:access-dashboard,auth,can:update-abilities,abilities |
|        | DELETE    | backend/abilities/{ability}        | rinvex.fort.backend.abilities.delete               | Rinvex\Fort\Http\Controllers\Backend\AbilitiesController@delete                           | web,can:access-dashboard,auth,can:delete-abilities,abilities |
|        | GET|HEAD  | backend/roles                      | rinvex.fort.backend.roles.index                    | Rinvex\Fort\Http\Controllers\Backend\RolesController@index                                | web,can:access-dashboard,auth,can:list-roles,roles           |
|        | POST      | backend/roles/create               | rinvex.fort.backend.roles.store                    | Rinvex\Fort\Http\Controllers\Backend\RolesController@store                                | web,can:access-dashboard,auth,can:create-roles,roles         |
|        | GET|HEAD  | backend/roles/create               | rinvex.fort.backend.roles.create                   | Rinvex\Fort\Http\Controllers\Backend\RolesController@create                               | web,can:access-dashboard,auth,can:create-roles,roles         |
|        | DELETE    | backend/roles/{role}               | rinvex.fort.backend.roles.delete                   | Rinvex\Fort\Http\Controllers\Backend\RolesController@delete                               | web,can:access-dashboard,auth,can:delete-roles,roles         |
|        | PUT       | backend/roles/{role}               | rinvex.fort.backend.roles.update                   | Rinvex\Fort\Http\Controllers\Backend\RolesController@update                               | web,can:access-dashboard,auth,can:update-roles,roles         |
|        | GET|HEAD  | backend/roles/{role}               | rinvex.fort.backend.roles.edit                     | Rinvex\Fort\Http\Controllers\Backend\RolesController@edit                                 | web,can:access-dashboard,auth,can:update-roles,roles         |
|        | GET|HEAD  | backend/users                      | rinvex.fort.backend.users.index                    | Rinvex\Fort\Http\Controllers\Backend\UsersController@index                                | web,can:access-dashboard,auth,can:list-users,users           |
|        | POST      | backend/users/create               | rinvex.fort.backend.users.store                    | Rinvex\Fort\Http\Controllers\Backend\UsersController@store                                | web,can:access-dashboard,auth,can:create-users,users         |
|        | GET|HEAD  | backend/users/create               | rinvex.fort.backend.users.create                   | Rinvex\Fort\Http\Controllers\Backend\UsersController@create                               | web,can:access-dashboard,auth,can:create-users,users         |
|        | DELETE    | backend/users/{user}               | rinvex.fort.backend.users.delete                   | Rinvex\Fort\Http\Controllers\Backend\UsersController@delete                               | web,can:access-dashboard,auth,can:delete-users,users         |
|        | PUT       | backend/users/{user}               | rinvex.fort.backend.users.update                   | Rinvex\Fort\Http\Controllers\Backend\UsersController@update                               | web,can:access-dashboard,auth,can:update-users,users         |
|        | GET|HEAD  | backend/users/{user}               | rinvex.fort.backend.users.edit                     | Rinvex\Fort\Http\Controllers\Backend\UsersController@edit                                 | web,can:access-dashboard,auth,can:update-users,users

We can use this as start point and extend the existing policy classes with our new functionality to show our forms

Alternative solution (first prototype?)

Based on "Make it work then make it better", we should create a prototype.
With this, i'm very sure, we find another way how we can implement this feature... anyway...

We extend our config file, where we can define which route needs some additional security check.

Example:

'security' => [
	'rinvex.fort.frontend.user.sessions' => 'password',
	'rinvex.fort.backend.*'				 => 'twofactor'
],

Then we're creating a new middleware (e.g. security) which will be used in the same way as the web middleware.
This middleware checks at first, if the current route is defined in the config.

If so, then we check a session variable (each route has it's own session).
If the session is valid, show the requested page.

If not, we have to redirect to our "enter password" / "enter twofactor" page.
If the confirmation was successful, we will call the original requested page again.


If you have another idea - feel free to post it :)

I hope my ideas are understandable and you can follow my thoughts.

Thanks a lot :)

SSO Login

Hello,

I have one question. Are you thinking about implement a Single Sign-On strategy (SAML2) as alternative to your package? IMHO is great business feature. What do you think?

Best Regards
Peter

User model

I did several tests with the package and the biggest problem was found in the customization of the user model because the information in my database is different.

I think it would be better for the package to allow the use of a customized user model to be easier to load through the configuration.

Unknown column 'username' or goes to register view trying to login

Error

QueryException in Connection.php line 761:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'where clause' (SQL: select * from `users` where `username` = emahuni limit 1)

that happens when trying to log in using username, if email is used then it goes to registration page.

Published resources cannot be overriden

I have published fort views to my app and they cannot be overridden as per Laravel documentation.
I wanted to change the blade layout template that Rinvex Fort is extending to another one and it seems to ignore the published views that I modify and still use the ones in the fort package instead of the published ones in /resources/views/vendors/rinv....

What could be the problem?

I saw this on laracast, but can't figure out if fort has a class alias that I am not seeing... Fort is using loadViewFrom() as expected, but still nothing is happening. My guess is that the directory to which it is being published to isn't correct.

This goes for the config file as well... the configuration isn't merging at all.

Two Factor Auth

Hi,

everything is working fine so far.

I created a new user.

  • welcome email sent

  • activation email sent

  • activation is done for the created user

  • Logged in without Two Factor

  • In the User Settings
    ** Filled First Name and Last Name
    ** Set my phone number ( schema: +491234567890
    ** Set Country to "Germany" --> DB: "de"

  • Saved Profile

  • enabled Two Factor via Google Authenticator

  • Checked the DB --> field "two_factor" is filled

  • Logout

  • Tried to login with the user credentials

Expected: View to enter the two factor code
Current: Login view with "You have to login first"

Based on what I can see via Debugbar

  • POST login was successful
  • tries to run "/verification/phone/verify"
  • redirect to "/login"

I have added some debug statements, the result for $result inside processLogin is null.

Is it not implemented (yet - like the social auth) or did I forgot something?

Password not encryped when using my own user model

Hi,

I updated my app to the latest develop branch.

I have my own user model which is extending the rinvex user model.
Everything seems ok and the seeds are running without any errors.

But while checking the user table, I realized that the passwords are not encrypted from the event handler Rinvex\Fort\Handlers\UserHandler.

If I change the used model in the seed to the Rinvex User Model the password is encrypted as expected.

User Handling or a known feature ;) ?

Package cannot be installed

I am trying to install fort on Laravel 5.3 and this is what I am getting as if the package is not under packagist.

running composer require rinvex/fort

spits the following:
[InvalidArgumentException] Could not find package rinvex/fort at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

Is there something that I am missing or there is something wrong with the packagist repository. How do I install it manually after cloning this git?

FatalThrowableError in AccountController.php line 163: Call to a member function getTwoFactor() on null

This happens whenever I tried to access routes with the following line for two factor authentication in vendor/rinvex/fort/src/Http/Controllers/AccountController.php:

$this->currentUser ... ;

for routes such as

/account/page
or
/account/twofactor/totp/enable

I inserted code:
use Illuminate\Support\Facades\Auth; // (at top of coz)
then i inserted:
$this->currentUser = Auth::guard($this->getGuard())->user() ?: Auth::guard($this->getGuard())->attemptUser();
just below:
parent::__construct();
in the class' constructor.

and it worked, though I am not sure of the code involved between where it was supposed to fetch the user and where i just fetched it. It seems like the current user or attempt user wasn't available on construction in vendor/rinvex/fort/src/Http/Controllers/FoundationController.php where it ($this->currentUser) was supposed to be assigned.

I am using laravel 5.3

Type error: Argument 1 passed to Rinvex\Fort\Handlers\GenericHandler::authLockout() must be an instance of Illuminate\Http\Request, instance of Illuminate\Auth\Events\Lockout given

Exception when login attempts more than 5 times

(1/1) FatalThrowableErrorType error: Argument 1 passed to Rinvex\Fort\Handlers\GenericHandler::authLockout() must be an instance of Illuminate\Http\Request, instance of Illuminate\Auth\Events\Lockout given

in GenericHandler.php (line 56)
at GenericHandler->authLockout(object(Lockout))
at call_user_func_array(array(object(GenericHandler), 'authLockout'), array(object(Lockout)))in Dispatcher.php (line 367)
at Dispatcher->Illuminate\Events{closure}('Illuminate\Auth\Events\Lockout', array(object(Lockout)))in Dispatcher.php (line 199)
at Dispatcher->dispatch('Illuminate\Auth\Events\Lockout')in helpers.php (line 446)
at event(object(Lockout))in ThrottlesLogins.php (line 81)
at SessionGuard->fireLockoutEvent(object(Request))in SessionGuard.php (line 96)
at SessionGuard->attempt(array('is_active' => true, 'username' => 'Fort', 'password' => 'IIvQSerN8wRy65Dsa'), false)in AuthenticationController.php (line 60)
at AuthenticationController->login(object(AuthenticationRequest))
at call_user_func_array(array(object(AuthenticationController), 'login'), array(object(AuthenticationRequest)))in Controller.php (line 55)
at Controller->callAction('login', array(object(AuthenticationRequest)))in ControllerDispatcher.php (line 44)
at ControllerDispatcher->dispatch(object(Route), object(AuthenticationController), 'login')in Route.php (line 203)
at Route->runController()in Route.php (line 160)
at Route->run()in Router.php (line 574)
at Router->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in RedirectIfAuthenticated.php (line 29)
at RedirectIfAuthenticated->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in NoHttpCache.php (line 23)
at NoHttpCache->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in UpdateLastActivity.php (line 23)
at UpdateLastActivity->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Abilities.php (line 38)
at Abilities->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in SubstituteBindings.php (line 41)
at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in VerifyCsrfToken.php (line 65)
at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ShareErrorsFromSession.php (line 49)
at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in StartSession.php (line 64)
at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37)
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in EncryptCookies.php (line 59)
at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Router.php (line 576)
at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 535)
at Router->dispatchToRoute(object(Request))in Router.php (line 513)
at Router->dispatch(object(Request))in Kernel.php (line 176)
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ValidatePostSize.php (line 27)
at ValidatePostSize->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForMaintenanceMode.php (line 46)
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Kernel.php (line 151)
at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116)
at Kernel->handle(object(Request))in index.php (line 53)
at require_once('/home/savvy/Code/testFort/public/index.php')in server.php (line 21)

(1/1) ErrorExceptionCreating default object from empty value

in UpdateLastActivity.php (line 37)
at HandleExceptions->handleError(2, 'Creating default object from empty value', '/home/savvy/Code/testFort/vendor/rinvex/fort/src/Http/Middleware/UpdateLastActivity.php', 37, array('request' => object(Request), 'response' =>object(Response), 'user' => object(stdClass)))in UpdateLastActivity.php (line 37)
at UpdateLastActivity->terminate(object(Request), object(Response))in Kernel.php (line 218)
at Kernel->terminateMiddleware(object(Request), object(Response))in Kernel.php (line 189)
at Kernel->terminate(object(Request), object(Response))in index.php (line 58)
at require_once('/home/savvy/Code/testFort/public/index.php')in server.php (line 21)

Failing to update composer dependencies because of Rivex Fort -> Rivex repository

There is a dependency conflict with Rinvex Fort. In composer.json for Fort, dependencies for Repository are causing a conflict on Laravel 5.3.x. hence I can't update my Laravel 5.3.x app.

Rinvex Fort wants Repository @dev-develop that requires Laravel 5.4.x. packages like Laravel Contracts 5.4.x though the rest of the code base is using Laravel 5.3.x code.

I thought tagging was meant to avoid breaking changes among code bases. Here Fort 0.0.3 should actually be version 1.0.0 or something as it uses Laravel 5.4.x.
Fort version 0.0.2 should declare that it requires repository up to version 2.x.x, and not just require dev-develop as the newer version is now using Laravel 5.4.x.

The solution is to put a requirement for repository at version 2.x.x in Fort composer.json as follows:

        "rinvex/repository": "dev-develop",
        "laravelcollective/html": "^5.3.0",

should be changed to

        "rinvex/repository": "^2.0.1",
        "laravelcollective/html": "^5.3.0",

Then tag the newer repository version to 3.x.x.

The reason I wrote this is to try and make you change all future versions including the one in dev-develop when tagging it so that this doesn't happen again.

Here is the error, if you go through it and go through the composer.json file of Fort you will quickly see the problem. Note that I can't update to Fort version > 0.0.2 as I am using Laravel 5.3.x not 5.4.x:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install laravel/framework v5.3.31
    - Conclusion: don't install laravel/framework v5.3.30
    - Conclusion: remove laravel/framework v5.3.29
    - Conclusion: don't install laravel/framework v5.3.29
    - Conclusion: don't install laravel/framework v5.3.28
    - Conclusion: don't install laravel/framework v5.3.27
    - Conclusion: don't install laravel/framework v5.3.26
    - Conclusion: don't install laravel/framework v5.3.25
    - Conclusion: don't install laravel/framework v5.3.24
    - Conclusion: don't install laravel/framework v5.3.23
    - Conclusion: don't install laravel/framework v5.3.22
    - Conclusion: don't install laravel/framework v5.3.21
    - Conclusion: don't install laravel/framework v5.3.20
    - Conclusion: don't install laravel/framework v5.3.19
    - Conclusion: don't install laravel/framework v5.3.18
    - Conclusion: don't install laravel/framework v5.3.17
    - Conclusion: don't install laravel/framework v5.3.16
    - Conclusion: don't install laravel/framework v5.3.15
    - Conclusion: don't install laravel/framework v5.3.14
    - Conclusion: don't install laravel/framework v5.3.13
    - Conclusion: don't install laravel/framework v5.3.12
    - Conclusion: don't install laravel/framework v5.3.11
    - Conclusion: don't install laravel/framework v5.3.10
    - Conclusion: don't install laravel/framework v5.3.9
    - Conclusion: don't install laravel/framework v5.3.8
    - Conclusion: don't install laravel/framework v5.3.7
    - Conclusion: don't install laravel/framework v5.3.6
    - Conclusion: don't install laravel/framework v5.3.5
    - Conclusion: don't install laravel/framework v5.3.4
    - Conclusion: don't install laravel/framework v5.3.3
    - Conclusion: don't install laravel/framework v5.3.2
    - Conclusion: don't install laravel/framework v5.3.1
    - Conclusion: don't install laravel/framework v5.3.0
    - Conclusion: don't install laravel/framework v5.3.0-RC1
    - rinvex/fort v0.0.2 requires rinvex/repository dev-develop -> satisfiable by rinvex/repository[dev-develop].
    - rinvex/fort v0.0.2 requires rinvex/repository dev-develop -> satisfiable by rinvex/repository[dev-develop].
    - rinvex/repository dev-develop requires illuminate/contracts ~5.4.0 -> satisfiable by laravel/framework[5.4.x-dev], illuminate/contracts[5.4.x-dev, v5.4.0, v
5.4.13, v5.4.17, v5.4.19, v5.4.9].
    - rinvex/repository dev-develop requires illuminate/contracts ~5.4.0 -> satisfiable by laravel/framework[5.4.x-dev], illuminate/contracts[5.4.x-dev, v5.4.0, v
5.4.13, v5.4.17, v5.4.19, v5.4.9].
    - Can only install one of: laravel/framework[5.4.x-dev, 5.3.x-dev].
    - don't install illuminate/contracts 5.4.x-dev|don't install laravel/framework 5.3.x-dev
    - don't install illuminate/contracts v5.4.0|don't install laravel/framework 5.3.x-dev
    - don't install illuminate/contracts v5.4.13|don't install laravel/framework 5.3.x-dev
    - don't install illuminate/contracts v5.4.17|don't install laravel/framework 5.3.x-dev
    - don't install illuminate/contracts v5.4.19|don't install laravel/framework 5.3.x-dev
    - don't install illuminate/contracts v5.4.9|don't install laravel/framework 5.3.x-dev
    - Installation request for laravel/framework 5.3.* -> satisfiable by laravel/framework[5.3.x-dev, v5.3.0, v5.3.0-RC1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.
13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.29, v5.3.3
, v5.3.30, v5.3.31, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9].
    - Installation request for rinvex/fort ^0.0.2 -> satisfiable by rinvex/fort[v0.0.2].

Errors with Laravel 5.4

Hi,

while trying to reproduce #64 I got the following error while running the following command:

php artisan db:seed --class=\Rinvex\Fort\Seeds\DatabaseSeeder

CLI Output:

Seeding: Rinvex\Fort\Seeds\AbilitiesSeeder
                                                                               
[Symfony\Component\Debug\Exception\FatalErrorException]                      
Declaration of Rinvex\Cacheable\CacheableEloquent::updated($callback, $priority = 0) must be compatible with Illuminate\Database\Eloquent\Model::updated($callback)                                                                

PHP: 7.1.0
MySQL: 5.6.34
Laravel: 5.4
Fort: dev-develop
Composer
** minimum-stability: dev

FatalThrowableError in TokenGuard.php line 41:

FatalThrowableError in TokenGuard.php line 41:
Type error: Argument 1 passed to Illuminate\Auth\TokenGuard::__construct() must be an instance of Illuminate\Contracts\Auth\UserProvider, instance of Rinvex\Fort\Repositories\UserRepository given, called in C:\dev\buck\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php on line 159

This is happening when trying to access api group route:

eg: 'api/user'

that is:

    Route::get('/user', function(Request $request)
    {
        return $request->user();
    })->middleware('auth:api');

anything in api that uses that middleware throws that error.

VERSION tagging needed

One of the most terrifying thing to do to this package is update it.

I noticed that the last update i did, though it fixed several bugs, had breaking changes that didn't deserve to be in the same major version number as the one i had before the update, as stipulated by samver. It seems like updating this package just gives the current master changes.

Unless I am missing something, please tag this package to make it easy to update without fearing any breaking changes in the update.

Problem with composer require

Hi,

I have an error when I try install rinvex/fort plugin to my project.
composer require rinvex/fort

[InvalidArgumentException]
Could not find package * at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

When I add manually this plugin to composer.json
I got:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for rinvex/fort dev-master -> satisfiable by rinvex/fort[dev-master].
- rinvex/fort dev-master requires rinvex/support dev-develop -> satisfiable by rinvex/support[dev-develop] but these conflict with your requirements or minimum-stability.

How can I properly install this plugin?
I'm using laravel 5.3

Best Regards
Peter

Unable to save user settings

Hi,

while testing the latest developversion on Laravel 5.3 I got an error while updating my profile.

I deactivated my custom routes to ensure I'm using the package controller and requests.

But the result is the same:

Type error: Argument 1 passed to Rinvex\Fort\Models\User::setTwoFactorAttribute() must be of the type array, null given, called in ...../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 2878

in Authenticatable.php line 53
at User->setTwoFactorAttribute(null) in Model.php line 2878
at Model->setAttribute('two_factor', null) in Model.php line 442
at Model->fill(array('username' => 'mreinhardt', 'password' => null, 'two_factor' => null, 'email' => '[email protected]', 'email_verified' => null, 'email_verified_at' => null, 'phone' => '+4915111334215', 'phone_verified' => null, 'phone_verified_at' => null, 'prefix' => null, 'first_name' => 'Marcus', 'middle_name' => null, 'last_name' => 'Reinhardt', 'suffix' => null, 'job_title' => null, 'country' => null, 'birthdate' => null, 'gender' => 'undisclosed', 'active' => null, 'login_at' => null)) in Model.php line 1411
at Model->update(array('username' => 'mreinhardt', 'password' => null, 'two_factor' => null, 'email' => '[email protected]', 'email_verified' => null, 'email_verified_at' => null, 'phone' => '+4915111334215', 'phone_verified' => null, 'phone_verified_at' => null, 'prefix' => null, 'first_name' => 'Marcus', 'middle_name' => null, 'last_name' => 'Reinhardt', 'suffix' => null, 'job_title' => null, 'country' => null, 'birthdate' => null, 'gender' => 'undisclosed', 'active' => null, 'login_at' => null)) in UserSettingsController.php line 83
at UserSettingsController->update(object(UserSettingsUpdateRequest))
at call_user_func_array(array(object(UserSettingsController), 'update'), array(object(UserSettingsUpdateRequest))) in Controller.php line 55
at Controller->callAction('update', array(object(UserSettingsUpdateRequest))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(UserSettingsController), 'update') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 41
at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Abilities.php line 49
at Abilities->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53

Any idea how to solve or did i missed something?

Thanks.

[Bug/Question] Indexes / new Datatypes with MySQL 5.6.34

Hi,

after solving the first problem, here the next one :)

Since Laravel 5.4 uses utf8mb4 each user with mysql <=5.7.(*/7) will see the following error message(s) while running the migrate command:

[Illuminate\Database\QueryException]                                                                                                                                                 
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))  
                                                                                                                                                                                                                                                                                                      
  [PDOException]                                                                                                   
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes  

Question / Possible Solutions:

  • Should we check for the current mysql version --> if version <= 5.7 then add Schema::defaultStringLength(191); as described in the laravel documentation
    • Here we have to check, is it mysql / mariadb / postgres - not sure if we generate here some overhead ( like my modified seeds ;) )
  • Manipulate the database config and change the current charset to utf8
    • Here we should check, if utf8mb4 is defined - if not, keep it as it is
  • keep it as it is and add some lines to the installation instructions

Laravel 5.3 on Valet

Try to install it with composer require rinvex/fort. Got this error message:

[InvalidArgumentException]

Could not find package rinvex/fort at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

When I try with : composer require rinvex/fort ~1.0@dev, I get:

Problem 1
    - Installation request for rinvex/fort ~1.0@dev -> satisfiable by rinvex/fort[1.0.x-dev].
    - rinvex/fort 1.0.x-dev requires rinvex/support dev-develop -> satisfiable by rinvex/support[dev-develop] but these conflict with your requirements or minimum-stability.

On Homestead, where I have a test project with Laravel 5.2, installation passes with no problem.

PHP version 7.0 on both.

Seeder's aren't working with translation

Hi,

updated the package to the latest develop update.

While running

php artisan migrate:refresh --seed

I get the following error:

[Illuminate\Database\QueryException]                                                                                                                                                                                                        
  Array to string conversion (SQL: insert into "rinvex_fort_abilities" ("action", "resource", "name", "updated_at", "created_at") values (superadmin, global, Super Administrator, 2017-01-30 17:55:51, 2017-01-30 17:55:51) returning "id")  

For some tests, I have changed the abilities.json from:

{
        "action": "<action>",
        "resource": "<resource>",
        "policy": "<policy>",
        "name": { "en" : "<name>" }
}

To:

{
        "action": "<action>",
        "resource": "<resource>",
        "policy": "<policy>",
        "name": "<name>"
}

It works fine.

In the Database, the result for name is the following:

{"en":"Can Delete Existing Users"}

Same for the roles.json.

If you want, I can create a PR :)

Laravel 5.4 install error

im getting this error when running composer require rinvex/fort

Problem 1
    - Installation request for rinvex/fort ^0.0.2 -> satisfiable by rinvex/fort[v0.0.2].
    - rinvex/fort v0.0.2 requires rinvex/repository dev-develop -> satisfiable by rinvex/repository[dev-develop] but these conflict with your requirements or minimum-stability.

BadMethodCallException when logging in after database seed

I am however getting a challenge when trying to login or register a new user after seeding the db. I get the following error. I am using version 0.0.3 on Laravel 5.4.9. Thanks for you help in advance

Whoops, looks like something went wrong.

1/1
BadMethodCallException in Builder.php line 2508:
Call to undefined method Illuminate\Database\Query\Builder::isEmailVerified()
in Builder.php line 2508
at Builder->__call('isEmailVerified', array()) in Builder.php line 1332
at Builder->__call('isEmailVerified', array()) in Model.php line 1316
at Model->__call('isEmailVerified', array()) in SessionGuard.php line 203
at SessionGuard->attempt(array('username' => 'Fort', 'password' => 'xwohIkswHX4F49pw', 'active' => true), false) in AuthenticationController.php line 69
at AuthenticationController->login(object(UserAuthenticationRequest))
at call_user_func_array(array(object(AuthenticationController), 'login'), array(object(UserAuthenticationRequest))) in Controller.php line 55
at Controller->callAction('login', array(object(UserAuthenticationRequest))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(AuthenticationController), 'login') in Route.php line 203
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing{closure}(object(Request)) in RedirectIfAuthenticated.php line 41
at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Abilities.php line 49
at Abilities->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 5

Documentation and views needed

I'm still very new to Laravel and still learning some of the techniques. But I like your package a lot and am willing to contribute, but I've been scratching my head unnecessarily on how to implement this whole package and that alone can turn devs away.

What I am missing is how to create abilities and roles, and then assign users to the created roles. It'll be great if views were included in the package to handle this and documentation to further show how to use the abilities and roles in the code.

Routes like:

\auth\abilities for CRUD of abilities
\auth\roles for CRUD of roles in conjunction with abilities
\auth\user_roles for assigning roles to users

There should also be a database seeding of an admin and a normal user role with a few exemplar roles and abilities packaged as publishables with fort.

New Layout.blade.php file assuming styles, fonts, and script sources (breaks on other configs)

Ok the fix to:
Published resources cannot be overriden #26 Closed emahuni opened this Issue 3 days ago · 3 comments

was brilliant work 👍 , however it spawned a simple deal-breaker to would-be package users.

The style, fonts and script sources are just too assumed and too dependent on the referenced code-base.
Output on my setup:

image

I think the default Laravel Scafolding styles, scripts and fonts should be used... maybe just take the default scaffolding and use that in the default layout file and explain to user to publish it and customize it in the layout file. I don't even use any of the assumed structure nor sources in my configuration, which means mostly to other users it may break as well.

Therefore just using the default scaffolding can cover those tracks, and if the user had customized it means they'll know exactly what's going on and a bit of explanation on the layout page maybe after yielding of content into common.layout file would do justice to those that see the unstyled, un-jqueried and un-bootstraped page and don't understand what's going on.

Add question and answer password recovery

It's of great convenience to add an option to make password recovery work offline without any email or phone as recovery option. Implementing this can help with offline, local-only applications with offline functionality as their requirement.

Implementation options:

  • User can be asked to choose/create recovery questions maybe two or three that should be answered properly before the recovery page is presented to the user.
  • User can actually provide clues to help them remember the password when offline.

Wrong route name for registration

There is a misspelling of the route name: it says rivnexinstead of rinvex
`InvalidArgumentException in UrlGenerator.php line 314: Route [rivnex.fort.auth.login] not defined.

in UrlGenerator.php line 314
at UrlGenerator->route('rivnex.fort.auth.login', array()) in Redirector.php line 157
at Redirector->route('rivnex.fort.auth.login') in helpers.php line 38
at intend(array('route' => 'rivnex.fort.auth.login', 'with' => array('rinvex.fort.alert.success' => 'Registration completed successfully!'))) in AuthenticationController.php line 142`

Generally i have gone through the source and found the problem on line 141 of file AuthenticationController.php

// Registration completed successfully case SessionGuard::AUTH_REGISTERED: default: return intend([ 'route' => 'rivnex.fort.auth.login', 'with' => ['rinvex.fort.alert.success' => Lang::get($result)], ]); }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.