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

Login without additional redirect #35

Open
chrfickinger opened this issue Apr 9, 2024 · 4 comments
Open

Login without additional redirect #35

chrfickinger opened this issue Apr 9, 2024 · 4 comments
Labels
enhancement New feature or request help wanted Feel free to make a pull request implementing this featured

Comments

@chrfickinger
Copy link

Hi Markus.
I really love your plugin, it works perfectly. Just one small thing :-)

I set 'onlyOauth' => true because I only want to allow users to login via oauth login screen. But there is one additional click necessary before I am redirected to the oauth login screen (See sreenshot!). Is there a way to skip this step and directly redirect to th login screen, because this is the only possibility to login anyway?

01

@thathoff
Copy link
Owner

thathoff commented Apr 9, 2024

This should be possible, at least if you have just one provider configured. And I think it’s only possible with JavaScript redirect in this screen but I really like the idea.

@thathoff thathoff added help wanted Feel free to make a pull request implementing this featured enhancement New feature or request labels Apr 9, 2024
@chrfickinger
Copy link
Author

Cool, in my case, it's actually just one provider. Could you help me to implement the javascript? Where in the plugin does the javascript have to be inserted?

In future you could make the value configurable, e.g. 'autoRedirect' => true

@thathoff
Copy link
Owner

thathoff commented Apr 9, 2024

The setting needs to be included in the API route here: https://github.com/thathoff/kirby-oauth/blob/master/lib/Controller.php#L42

After this the settings are available to the LoginScreen in JavaScript here: https://github.com/thathoff/kirby-oauth/blob/master/src/components/LoginScreen.vue#L42

I would check if we have an error if not and this setting is enabled and just one provider is available in the settings you can do a document.location = this.settings.providers[0].href

@chrfickinger
Copy link
Author

Thanks a lot. I'll give it a try :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Feel free to make a pull request implementing this featured
Projects
None yet
Development

No branches or pull requests

2 participants