aaemnnosttv / wp-cli-login-command

Log in to WordPress with secure passwordless magic links.
https://aaemnnost.tv/wp-cli-commands/login/
MIT License
300 stars 48 forks source link

When used with Unyson framework causes issues #61

Closed uhlhosting closed 1 year ago

uhlhosting commented 1 year ago

Hi,

We have 2 websites running themes built with unyson framework, when we use the sso login,we get redirected to unyson website not our website.

uhlhosting commented 1 year ago

Anyone?

aaemnnosttv commented 1 year ago

When you say "sso login" are you referring to the URL-based login created by this command or something else? I'm not familiar with the Unyson framework.

uhlhosting commented 1 year ago

When you say "sso login" are you referring to the URL-based login created by this command or something else? I'm not familiar with the Unyson framework.

@aaemnnosttv yes that is correct. When a website uses your plugin and uses the URL based login, the main site gets replaced by unyson.io.

aaemnnosttv commented 1 year ago

Sorry, I can't provide framework-specific support. If you're familiar with that framework and can identify the source of an issue, I'd be happy to take another look.

uhlhosting commented 1 year ago

Sorry, I can't provide framework-specific support. If you're familiar with that framework and can identify the source of an issue, I'd be happy to take another look.

That platform if youd research a bit its a very fundamental wordpress platform. Widely used in wordpress. So its not another platform its wordpress yet this framework better to say works around wordpress. Id suggest you just take a look at this when time allows. Unyson framework is quite used in many themes.

aaemnnosttv commented 1 year ago

Hello again 👋 I ended up looking into this and it is indeed an issue in the framework as it overrides a few $_SERVER globals whenever WP CLI is being used, so long as there isn't already a host set (see https://github.com/ThemeFuse/Unyson/commit/a08d7f34006dd974b9c9eebb4cc60dcaea7e6bcf).

I'm not sure why that is, but this is the source of the conflict. As a workaround, you can use the global --url flag to prevent this from happening when creating a login like so:

wp login create my-user --url=https://example.com

where example.com is your site's URL. I'd suggest opening an issue on the framework side to address the root cause, but at least now you should be unblocked 👍