如何在node-oidc-provider中重定向失败的登录尝试

时间:2019-02-14 21:20:09

标签: node.js express openid openid-connect

我正在使用node.js,express.js和node-oidc-provider设置OpenID Connect提供程序。我一直在研究https://github.com/panva/node-oidc-provider-example/tree/master/03-oidc-views-accounts中的示例,但是它永远不会处理失败的身份验证。如果用户输入了错误的密码,如何将用户重定向回登录页面?

public function beforeUpdate(Request $request, $id, $data) {

    // ID do componente
    $entity = $id;

    // Order do Componente
    $model = $this->getCurrentEntry();
    $order = $model->order;

    $entity->moveAfter($order);


    // $post->tags()->moveBefore($entityToMove, $whereToMoveEntity);
    // $post->tags()->moveAfter($entityToMove, $whereToMoveEntity);

    // dd($request->all(), $this->getCurrentEntry());
    // moveAfter();
    // moveBefore();



    return [];
}



 // VIEW 

  <div class="list-group">
       @foreach( $model->components as $value)
        @php($selected = $components[$value->component])
        <div class="form-group row">
            <label class="col-sm-6 col-form-label">{{$value->order}} - {{ $selected->title }}</label>
            <div class="col-sm-6">
                <a href="{{ route('website.pages.components.order.update', [$site, $slug, $value->id, 'order' => 'up']) }}" class="fa fa-angle-double-up btn btn-primary btn-sm"></a>
                <a href="{{ route('website.pages.components.order.update', [$site, $slug, $value->id, 'order' => 'down']) }}" class="fa fa-angle-double-down btn btn-primary btn-sm"></a>
                <a href="{{ route('website.pages.components.edit',  [$site, $slug, $value->id]) }}" class="btn btn-warning btn-sm">Editar</a>
                <a href="" class="btn btn-danger btn-sm">Deletar</a>
            </div>
        </div>
    @endforeach

<a class="btn btn-primary" href="{{ route('website.pages.components.create', [$site, $slug]) }}"> Adicionar Componente </a>

1 个答案:

答案 0 :(得分:0)

就像在任何快速应用中一样。这样想吧。仅成功解决交互问题,否则,如果您希望退出交互并将控制权交还给客户端,则会出错。

我倾向于单独开发交互,只有完成后才将它们插入oidc-provider。