73 lines
3.3 KiB
PHP
73 lines
3.3 KiB
PHP
@extends('includes.login.index')
|
|
|
|
@section('content')
|
|
|
|
<h6 style="text-align: center; margin-bottom: 10%;">Tetap Semula Kata Laluan</h6>
|
|
|
|
<form role="form" method="POST" action="{{ route('password.update') }}">
|
|
@csrf
|
|
|
|
<input type="hidden" name="token" value="{{ $token }}">
|
|
|
|
<div class="input-group input-group-outline my-3 bg-light {{ $errors->has('email') ? ' has-danger' : '' }} mb-3">
|
|
|
|
<input class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" placeholder="{{ __('Email') }}" type="email" name="email" value="{{ $email ?? old('email') }}" required autofocus readonly>
|
|
</div>
|
|
@if ($errors->has('email'))
|
|
<span class="invalid-feedback" role="alert">
|
|
<strong>{{ $errors->first('email') }}</strong>
|
|
</span>
|
|
@endif
|
|
|
|
<div class="input-group input-group-outline {{ $errors->has('password') ? ' has-danger' : '' }}">
|
|
<input id="password" onKeyUp="checkPasswordStrength();" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="{{ __('Password') }}" type="password" required>
|
|
</div>
|
|
@if ($errors->has('password'))
|
|
<span class="invalid-feedback" role="alert">
|
|
<strong>{{ $errors->first('password') }}</strong>
|
|
</span>
|
|
@endif
|
|
<div class="text-muted font-italic mb-3">
|
|
<small>{{ __('password strength') }}: <span class="text-muted font-weight-700" id="password-strength-status">none</span></small>
|
|
</div>
|
|
|
|
<div class="input-group input-group-outline my-3">
|
|
<div class="input-group input-group-alternative">
|
|
|
|
<input class="form-control" placeholder="{{ __('Confirm Password') }}" type="password" name="password_confirmation" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="text-center">
|
|
<button type="submit" class="btn bg-gradient-dark my-4" style="background: #4A4E59;">{{ __('Tetap Kata Laluan') }}</button>
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
function checkPasswordStrength() {
|
|
var number = /([0-9])/;
|
|
var alphabets = /([a-zA-Z])/;
|
|
var special_characters = /([~,!,@,#,$,%,^,&,*,-,_,+,=,?,>,<])/;
|
|
if ($('#password').val().length > 0 && $('#password').val().length < 6) {
|
|
$('#password-strength-status').removeClass();
|
|
$('#password-strength-status').addClass('text-danger font-weight-700');
|
|
$('#password-strength-status').html("Weak (should be atleast 6 characters.)");
|
|
} else if ($('#password').val().length == 0) {
|
|
$('#password-strength-status').removeClass();
|
|
$('#password-strength-status').addClass('text-muted font-weight-700');
|
|
$('#password-strength-status').html("None");
|
|
} else {
|
|
if ($('#password').val().match(number) && $('#password').val().match(alphabets) && $('#password').val().match(special_characters)) {
|
|
$('#password-strength-status').removeClass();
|
|
$('#password-strength-status').addClass('text-success font-weight-700');
|
|
$('#password-strength-status').html("Strong");
|
|
} else {
|
|
$('#password-strength-status').removeClass();
|
|
$('#password-strength-status').addClass('text-yellow font-weight-700');
|
|
$('#password-strength-status').html("Medium (should include alphabets, numbers and special characters.)");
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
@endsection |