@extends('layout')

@section('title', 'AuthStack &ndash; Authentication')

@section('css')
    <link href="https://login.uos.ac.uk/module.php/ucs/assets/css/style.css" rel="stylesheet" type="text/css"/>
    @if(env('APP_JS_DEV_MODE'))
        <link href="/css/sso.css" rel="stylesheet" type="text/css"/>
    @else
        <link href="/dist/css/sso.min.css" rel="stylesheet" type="text/css"/>
    @endif
@endsection


@section('javascript')
    <script src="/jspm_packages/system.js"></script>
    <script src="/jspm.config.js"></script>

    @if(env('APP_JS_DEV_MODE'))
        <script type="text/javascript">
            System.import('/authstack/pages/sso/index.js');
        </script>
    @else
        <script src="/dist/js/sso.min.js" type="text/javascript"></script>
    @endif
@endsection

@section('content')
    <h2 class="login-title">Reset your password</h2>

    <div id="loader">
        <div class="loader">Loading, please wait...</div>
        <p class="text-xs-center text-muted">Loading, please hold on...</p>
    </div>

    <div id="authentication" style="display:none">

        <form method="POST" action="{{ route('aud.password.update') }}">

            {{ csrf_field() }}

            <input type="hidden" name="token" value="{{ $token }}">

            <div class="form-group row">
                <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>

                <div class="col-md-6">
                    <input id="password" type="password"
                           class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password"
                           required>

                    @if ($errors->has('password'))
                        <span class="invalid-feedback">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                    @endif
                </div>
            </div>

            <div class="form-group row">
                <label for="password-confirm"
                       class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
                <div class="col-md-6">
                    <input id="password-confirm" type="password"
                           class="form-control{{ $errors->has('password_confirmation') ? ' is-invalid' : '' }}"
                           name="password_confirmation" required>

                    @if ($errors->has('password_confirmation'))
                        <span class="invalid-feedback">
                                        <strong>{{ $errors->first('password_confirmation') }}</strong>
                                    </span>
                    @endif
                </div>
            </div>

            <div class="form-group row mb-0">
                <div class="col-md-6 offset-md-4">
                    <button type="submit" class="btn btn-primary">
                        {{ __('Reset Password') }}
                    </button>
                </div>
            </div>
        </form>

    </div>
@endsection
