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

You need to install a service package or assign yourself the service to be used #3

Closed
Bossjava opened this issue Oct 10, 2023 · 5 comments

Comments

@Bossjava
Copy link

Bossjava commented Oct 10, 2023

image

之前是类加载不到,我改成了

new Google2FA();

然后报错

Call to undefined method PragmaRX\Google2FA\Google2FA::getQRCodeInline()

版本
asundust/dcat-auth-google-2fa (1.0.2)

  • Upgrading pragmarx/google2fa (v3.0.3 => v8.0.1)
  • Upgrading pragmarx/google2fa (v3.0.3 => v8.0.1)

我看Google2FA 也没有这个方法,请问是兼容到哪个版本?

@asundust
Copy link
Owner

已修复,升级1.0.3即可

@Bossjava
Copy link
Author

Bossjava commented Oct 10, 2023

  • pragmarx/google2fa-qrcode[v2.0.0, ..., v2.1.1, v3.0.0] require pragmarx/google2fa >=4.0 -> found pragmarx/google2fa[v4.0.0, v4.0.1, v4.0.2, v5.0.0, v6.0.0, v6.0.1, v6.1.0, v6.1.3, v7.0.0, 7.x-dev, 8.0.0, v8.0.1, 8.x-dev] but it conflicts with your root composer.json require (^2.0|^3.0).

pragmarx/google2fa-qrcode 依赖 pragmarx/google2fa >=4.0

image

@asundust
Copy link
Owner

我本地全新项目实测无此问题,由于我使用错了依赖,导致出现了/auth/setting页面报错的问题。
虽然我实测升级降级无遇到阻碍,不排除特殊情况导致无法正确升级,这边建议尝试先卸载,再重新安装试试看。
1.0.3版本后支持pragmarx/google2fa的最低版本为4.0起步,此前为3.0,如果你本地额外安装了此包建议升级一下。

@Bossjava
Copy link
Author

Bossjava commented Oct 10, 2023

image
我被这里坑了

另外如果报错
message: You need to install a service package or assign yourself the service to be used.

需要安装这个依赖,我在升级pragmarx/google2fa时,并没有帮我安装
composer require bacon/bacon-qr-code

谢谢大佬热心帮助,这个扩展很棒!

@asundust asundust changed the title 升级到1.0.2后打开/auth/setting页面报错 You need to install a service package or assign yourself the service to be used Oct 11, 2023
@asundust
Copy link
Owner

asundust commented Oct 11, 2023

bacon/bacon-qr-code中的二维码服务是需要自主安装,参见 https://github.com/antonioribeiro/google2fa-qrcode#built-in-qrcode-rendering-services 。而在dev模式(require --dev)是默认装了这两个包,我没注意到,所以我本地测试的时候没有复现。
已发布新版增加拦截提示。

@asundust asundust pinned this issue Oct 30, 2023
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

2 participants