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

Global access to $loginstatus #12

Open
marcus-at-localhost opened this issue Nov 11, 2020 · 1 comment
Open

Global access to $loginstatus #12

marcus-at-localhost opened this issue Nov 11, 2020 · 1 comment

Comments

@marcus-at-localhost
Copy link
Contributor

It seems that with version 1.1.2 the new $loginstatus variable that contains the user and the logout url is not global.
While we can use $kirby->user()->username() to show the logged in status in any template/footer snippet etc, what would be the best way to have access on $loginstatus['logouturl'] ?

I suppose the best would be to extend the User object? But I haven't wrapped my head around all the kirby internals so it's hard to come up with something.

Any idea?

@marcus-at-localhost
Copy link
Contributor Author

I guess the easiest is to use this directly in the template:
url('/no-permission', ['params' => ['action' => 'logout'], 'query' => ['prevloc' => Url::path()]])

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