stormpath / stormpath-laravel

Build simple, secure web applications with Stormpath and Laravel
Other
29 stars 6 forks source link

The view of login page has error #62

Open allen-li-webpower opened 7 years ago

allen-li-webpower commented 7 years ago

There is an error for login page view:

My laravel version is the newest 5.3.*

ErrorException in 3a641c2493fc436fb5153f1896779e570d564609.php line 26: Undefined variable: areaWrap (View: C:\wamp64\www\laravel\vendor\stormpath\laravel\src\views\login.blade.php)

I see the source code is below:

@if(config('stormpath.web.social.enabled'))
    {{--*/ $socialProviders = true /*--}}
    {{--*/ $areaWrap = 'small col-sm-8' /*--}}
    {{--*/ $classLabel = 'col-sm-12' /*--}}
    {{--*/ $classInput = 'col-sm-12' /*--}}
@else
    {{--*/ $socialProviders = false /*--}}
    {{--*/ $areaWrap = 'small col-sm-12' /*--}}
    {{--*/ $classLabel = 'col-sm-4' /*--}}
    {{--*/ $classInput = 'col-sm-8' /*--}}
@endif

It is just "how to set variables in a template",some one think using {{-- */ $var = 'value' /*--}} But it is not work.

@php ($var = 'value') is ok.

You can see : http://stackoverflow.com/questions/13002626/laravels-blade-how-can-i-set-variables-in-a-template

So,I think you can update it to:

@if(config('stormpath.web.social.enabled'))
    @php ($socialProviders = true)
    @php ($areaWrap = 'small col-sm-8')
    @php ($classLabel = 'col-sm-12')
    @php ($classInput = 'col-sm-12')
@else
    @php ($socialProviders = false)
    @php ($areaWrap = 'small col-sm-12')
    @php ($classLabel = 'col-sm-4')
    @php (classInput = 'col-sm-8')
@endif

Thanks!

allen-li-webpower commented 7 years ago

Of course, I can Overriding Package Views, https://laravel.com/docs/5.3/packages#views

bretterer commented 7 years ago

Hi @allen-li-webpower I currently have a fix in the develop branch for this, please see #58 for details.

I will be releasing a patch this week.

simontech commented 7 years ago

Just trying laravel/stormpath. Went through the docs on the stormpath site, running into this same error. (areaWrap) @bretterer

bretterer commented 7 years ago

@simontech, which version of the stormpath-laravel package are you using?

simontech commented 7 years ago

@bretterer "stormpath/laravel": "^0.4" (as listed in the setup docs here: https://docs.stormpath.com/php/laravel/latest/setup.html) I've also discovered an issue with the logout page and have created a ticket at stormpath.

Maybe the setup docs are out of date?

bretterer commented 7 years ago

The login fix was made on version 0.5, so make sure you do a composer update and the login page will be fixed. For the logout page issue, I am guessing you are trying to just visit /logout... please see the following ticket for the resolution here. https://github.com/stormpath/stormpath-laravel/issues/49

bretterer commented 7 years ago

The ^0.4 in the docs basically means get anything higher than 0.4 and keep up to date when you run composer update

simontech commented 7 years ago

That's what I thought about the ^0.4 getting the latest version. ...I just ran composer update last night so I should be getting the latest (0.5+) right? Also, not sure what the fix is for the logout/post issue. I read that thread and it's not completely clear. Do people need to create their own post forms and point them to the logout endpoint?

Lastly, it would be nice if the artisan "vendor publish" command also included the register, login logout.