doutang1992 2018-12-13 19:19
浏览 180
已采纳

不支持删除/ oauth / personal-access-tokens / token

I am having some weird problem with laravel passport that doesnt happen on localhost but it does online on webhosting when I want to revoke token.

DELETE to /oauth/personal-access-tokens/26b3a9adf97f20949156798fc491687446cacde48914124c717b6f3318866afd9590e0ddabc5efc1 not supported.

Everything else works.

  • 写回答

1条回答 默认 最新

  • dqroc48068 2018-12-13 20:26
    关注

    I created a local passport environment, this seemed to work for me in PersonalAccessTokens.vue:

    revoke(token) {
        axios.post('/oauth/personal-access-tokens/' + token.id, {'_method': 'DELETE'})
        .then(response => {
             this.getTokens();
        });
    }
    

    While axios will send a post, {'_method': 'DELETE'} tells Laravel to use the delete endpoint defined in Laravel\Passport\RouteRegistrar:

    $router->delete('/tokens/{token_id}', [
        'uses' => 'AuthorizedAccessTokenController@destroy',
    ]);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音
  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表
  • ¥15 DbVisualizer Pro 12.0.7 sql commander光标错位 显示位置与实际不符