Laravel 5.3密码重置错误,没有任何错误日志

时间:2017-01-23 14:48:43

标签: php laravel-5.3

我正在使用默认的laravel auth方法 当我尝试重置密码时,一切正常,直到我尝试发送重置表单。

此时,它只是向我发送任何日志错误 我知道发送了一个错误,因为我将以下行添加到App\Exceptions\handler.php

public function report(Exception $exception)
{
    Artisan::call('sms:basic');

    parent::report($exception);
}

所以,我收到发生错误的通知。我没有登录,新密码无效。

发生这种情况时,laravel.log文件为空。所以我不知道为什么不工作。

我使用的路线是:

Auth::routes();

有视图文件。

@extends('layouts.public')

@section('content')

        <!-- RESET FORM -->
        <!--===================================================-->
        <div class="cls-content">
            <div class="cls-content-sm panel">
                <div class="panel-body background-black fix-margin-top">
                    <div class="text-left"><img style="height: 90px; width: auto;margin-left: -25px;" src="{{ url('/img/logoTorqueWhite.svg') }}" alt="" class=""></div>
                </div>
            </div>
            <div class="cls-content-sm panel ">
                <div class="panel-body fix-margin-top">
                    <div class="pull-right"><a class="black" href="{{ url('/') }}"><i class="fa fa-times"></i></a></div>
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 vert-line">
                            <p>Réinitialiser votre mot de passe</p>
                            @if (session('status'))
                                <div class="alert alert-success">
                                    {{ session('status') }}
                                </div>
                            @endif
                            <form method="POST" role="form" action="{{ url('/password/reset') }}">
                                <div class="form-group text-left{{ $errors->has('email') ? ' has-error' : '' }}">
                                    <label>Courriel</label>
                                    <input id="email" type="email" name="email" class="form-control" placeholder="" value="{{ old('email') }}">
                                    @if ($errors->has('email'))
                                        <span class="form-control">
                                            <strong>{{ $errors->first('email') }}</strong>
                                        </span>
                                    @endif
                                </div>

                                <div class="form-group text-left{{ $errors->has('password') ? ' has-error' : '' }}">
                                    <label>Mot de passe</label>
                                    <input type="password" name="password" class="form-control" placeholder="">
                                    @if ($errors->has('password'))
                                        <span class="form-control">
                                            <strong>{{ $errors->first('password') }}</strong>
                                        </span>
                                    @endif
                                </div>

                                <div class="form-group text-left{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
                                    <label>Confirmer le mot de passe</label>
                                    <input type="password" name="password_confirmation" class="form-control" placeholder="">
                                    @if ($errors->has('password_confirmation'))
                                        <span class="form-control">
                                            <strong>{{ $errors->first('password_confirmation') }}</strong>
                                        </span>
                                    @endif
                                </div>

                                <div class="col-xs-12 no-padding">
                                    <div class="form-group text-right">
                                        <input name="reset" type="submit" class="btn btn-torque" value="RÉINITIALISER">
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="col-xs-12 col-sm-4">
                            <div class="valign text-right">
                                <p>Contactez-nous<br>
                                (819) 679-2944<br>
                                info@torquemanagement.ca</p>
                            </div>
                        </div>
                    </div>
                    <div class="row text-left">
                        {{--<div class="col-xs-12">
                        Vous avez oublié votre mot de passe? <a href="/password/reset">Cliquez ici</a><br>
                        Vous n'avez pas encore de compte Torque? Créé un compte
                        </div>--}}
                    </div>
                </div>
            </div>
        </div>
        <!--===================================================-->
@endsection

我在其他地方看到有人要求添加这条路线:

Route::get('test', function(){
    dd ( bcrypt('raw_password') == "encrypted_password_in_db");
});

它让我失意,这些家伙说它假设回归真实。 没有其他解释,但也许它可以帮助你帮助我。我真的不知道这是什么意思。

1 个答案:

答案 0 :(得分:0)

使用

保存新密码时

Hash::make('newpassword')

以后它会起作用:

Route::get('test', function(){
    dd (Hash::check('raw_password', 'encrypted-password'));
});

Laravel始终使用随机盐渍密码,因此您无法使用==

进行检查
相关问题