This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

cassiotalle
cassiotalle

Hello everybody Im using two plugins to fronend login the Users / Rainlab and Social Login / Flyn San

In neither method I am able to redirect to a specific page after login or Sign.

For the user plugin I was using the following configuration:

[account]
redirect = "{{get ('redirect')}}"

and for the Social Login Plugin I'm using the following code

{% for name, link in social_login_links %}
  <a href="{{ link }}?s={{get('redirect')?get('redirect'):url('/')}}&f={{''|page}}" class="social-button" id="{{name |lower }}-connect"> <span>Entrar com {{name}}</span></a>
{% endfor %}

In neither case am I achieving success

complete code follows:

    [account]
    redirect = "{{get('redirect')}}"
    paramCode = "code"
    forceSecure = 0
    requirePassword = 0

    [sociallogin]
    ==
    {% if not user %}

    {{ form_ajax('onSignin') }}
    {{url('/')}}

<h1 class="h3">Faça o seu login</h1>
    <div class="form-group">
        <label for="userSigninLogin">E-mail</label>
        <input
            name="login"
            type="text"
            class="form-control"
            id="userSigninLogin"
            placeholder="Seu e-mail" />
    </div>

    <div class="form-group">
        <label for="userSigninPassword">Senha</label>
        <input
            name="password"
            type="password"
            class="form-control"
            id="userSigninPassword"
            placeholder="Sua senha" />
    </div>

    {% if rememberLoginMode == 'ask' %}
    <div class="form-group">
        <div class="checkbox">
        <label><input name="remember" type="checkbox" value="1">Stay logged in</label>
        </div>
    </div>
    {% endif %}

<p class="mb-0"> ou </p>

<div class="pt-0 pb-2">
    {% for name, link in social_login_links %}
      <a href="{{ link }}?s={{get('redirect')?get('redirect'):url('/')}}&f={{''|page}}" class="social-button" id="{{name |lower }}-connect"> <span>Entrar com {{name}}</span></a>
    {% endfor %}
    </div>

<button type="submit" class="btn btn-primary">Entrar</button>
cassiotalle
cassiotalle

Hello. I haven't been able to solve this problem yet. I've been trying in many ways. But nothing yet.

The last attempt to try to redirect via Event :: listen For this I created an init.php file in the plugin folder with the following code:

    Event::listen('rainlab.user.login', function($user) {
    if(Session::has('redirect')){
      return Redirect::to(Session::get('redirect'));
    }
  });

I think it is something easy to solve but I have been trying for days

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.