首页 > 解决方案 > Laravel 护照:安装错误:不创建 oauth 公钥和私钥

问题描述

Laravel正在Vue.js使用MongoDB. 我在部署我的应用程序后遇到了一些问题Heroku,因为laravel/passport. 特别是当我想登录我的用户时。

当我尝试登录POST请求时返回:(Error 500: Unable to read key我的本地主机也有同样的错误)。

所以我在问这个问题之前尝试了很多事情,并按照laravel/passporthttps://laravel.com/docs/7.x/passport)的文档说明进行操作。事实上,除了这两个命令(显示相同的错误)之外,一切正常:

>php artisan passport:install
>php artisan passport:keys --force

这个错误是:

ErrorException
file_put_contents(/secret-keys/oauth\oauth-public.key): failed to open stream: No such file or directory

当然,这些命令不会在我的文件夹中创建我需要正确登录的密钥文件 ( oauth-private.key& oauth-public.key) 。storage

我试过这个,但它没有解决我的问题:

>composer install
>composer dump-autoload
>composer update --no-scripts
>composer update
>php artisan config:clear && php artisan cache:clear

我已经删除了我的vendor文件夹和composer.lock文件并运行composer install了,但没有解决我的问题。

最后,我已将其添加到我的 composer.json 文件中:

"post-install-cmd": [ 
        "php artisan clear-compiled",
        "chmod -R 777 storage", 
        "php artisan passport:keys"
    ]

没有再次解决我的问题。

我错过了什么?谁能帮我 ?

谢谢

标签: laravelmongodbvue.jsheroku

解决方案


推荐阅读