Я очень новичок в этом приложении, я использую auth_mellon и sso для входа в веб-приложение.Теперь у меня проблема, потому что я просто хочу знать, какие переменные и код мне нужно использовать, чтобы перенаправить мою страницу на другую.Я использовал redirect.js и window.location.replace, но он дает только домашнюю страницу моего веб-приложения.Мне нужно перенаправить его / веб-приложение / сменить пароль.Какие параметры мне нужно использовать для этого.
Вот мой код:
window.location.replace = "{{config('app.webapp-url')}}/change-password";
$.redirect( "{{config('app.webapp-url')}}/change-password", { 'edit': true, _token: "{{ csrf_token() }}"} );
Я использую laravel и php.
это весь мой код:
@extends('layouts.app')
@section('page-css')
<link href="{{ asset('/css/sweetalert.css') }}" rel="stylesheet" type="text/css" />
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Login</div>
<div class="panel-body">
<form onsubmit= "return check_expiry(this);" class="form-horizontal" method="POST" action="{{ route('login') }}">
{{ csrf_field() }}
@if(isset($_GET['SAMLRequest']))
<input type="hidden" id="SAMLRequest" name="SAMLRequest" value="{{ $_GET['SAMLRequest'] }}">
@endif
@if(isset($_GET['RelayState']))
<input type="hidden" id="RelayState" name="RelayState" value="{{ $_GET['RelayState'] }}">
@endif
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
<label for="username" class="col-md-4 control-label">User Initials</label>
<div class="col-md-6">
<input id="username" type="username" class="form-control" name="username" value="{{ old('username') }}" required autofocus>
@if ($errors->has('username'))
<span class="help-block">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" id="btnLogin" class="btn btn-primary">
Login
</button>
<a class="btn btn-link" <a href="{{config('app.webapp-url')}}/password/reset"</a>
Forgot Your Password?
</a>
</div>
</div>
</form>
<!-- <button id="btntest" class="btn btn-primary"> -->
<!-- Test -->
<!-- </button> -->
</div>
</div>
</div>
<div class="col-md-8 col-md-offset-2">
<div class="panel-heading"><b>WPP Single Sign-On provides unified login for the following applications:</b><br></div>
<div class="row">
<div class="col-md-3">
<img src="/images/webapp.png" width="150px",height="75px" title="webapp">
</div>
<div class="col-md-3">
<img src="/images/webapp.png" width="150px",height="75px" title="webapp">
</div>
<div class="col-md-3">
<img src="/images/webapp.png" width="150px",height="75px" title="webapp">
</div>
<div class="col-md-3">
<img src="/images/webapp.png" width="150px",height="75px" title="webapp">
</div>
</div>
<div class="row">
<div class="col-md-3">
<img src="/images/webapp.png" width="150px",height="75px" title="webapp">
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-scripts')
<script src="{{asset('/js/jquery-2.2.3.min.js')}}"></script>
<script src="{{asset('/js/sweetalert.min.js')}}"></script>
<script src="{{asset('/js/jquery.redirect.js')}}" type="text/javascript"></script>
<script>
function check_expiry(form) {
// alert("hello world");return false;
$.ajax({
type: 'POST',
url:"{{ route('expired.password.notification') }}",
data: {
//'_token': $('input[name=_token]').val(),
'username': $("#username").val(),
_token: "{{ csrf_token() }}"
},
success: function(result){
// if (result > 0 && result <= 14) {
if (result < 100){
if (confirm ("Considering changing your passwword. Your password will expire in " + result + " days. Please click OK to redirect to change password page.!")){
window.location.replace = "{{config('app.web-app')}}/change-password";
//$.redirect( "{{config('app.web-ap')}}/change-password", { 'edit': true, _token: "{{ csrf_token() }}"} );
return true;
}else{
return false;
}
}
},
});
}
//});
</script>
@endsection
Я ожидаю вывод, который перенаправит на страницу смены пароля.Я не знаю, нужен ли мне токен, sessionid.Просто мне нужен мой код, чтобы перенаправить его на правильный URL.Спасибо