Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page-independent frontend-login #15

Open
demlak opened this issue Mar 1, 2021 · 0 comments
Open

page-independent frontend-login #15

demlak opened this issue Mar 1, 2021 · 0 comments

Comments

@demlak
Copy link

demlak commented Mar 1, 2021

hey.. logging out is possible by visiting /logout
But whats a solution for a simple frontend login-page with maybe redirect to / after login?

accessing /no-permission to login, results into:

TypeError thrown with message "Argument 1 passed to go() must be of the type string, null given, called in /var/www/html/site/plugins/kirby-securedpages-1.2.0/src/loginform/LoginFormCtrl.php on line 31"

Stacktrace:
#9 TypeError in /var/www/html/kirby/config/helpers.php:223
#8 go in /var/www/html/site/plugins/kirby-securedpages-1.2.0/src/loginform/LoginFormCtrl.php:31
#7 Kirby\Cms\App:{closure} in [internal]:0
#6 Closure:call in /var/www/html/kirby/src/Toolkit/Controller.php:49
#5 Kirby\Toolkit\Controller:call in /var/www/html/kirby/src/Cms/App.php:459
#4 Kirby\Cms\App:controller in /var/www/html/kirby/src/Cms/Page.php:348
#3 Kirby\Cms\Page:controller in /var/www/html/kirby/src/Cms/Page.php:1169
#2 Kirby\Cms\Page:render in /var/www/html/kirby/src/Cms/App.php:686
#1 Kirby\Cms\App:io in /var/www/html/kirby/src/Cms/App.php:1039
#0 Kirby\Cms\App:render in /var/www/html/index.php:35

so it seems there needs to be a default argument to let go() never go empty.

my solution in src/loginform/LoginFormCtrl.php:

        if ($form->success()) {
//            go(get('prevloc'));
            if (!empty(get('prevloc'))) {
                go(get('prevloc'));
            } else {
                go('/');
            }
        }

no, it is possible to go to /no-permission to get default Login-Page. And after Login, you are redirected to /

this could also be changed to a specific option like kerli81.securedpages.loginform.default.go or similar..

(sorry, i am not familiar with git/github to add a pull request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant