mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-11-03 11:55:52 +01:00 
			
		
		
		
	After login, redirect to the original URL called
Fix an annoying issue in Admin, when loading an inner page (`/admin/pages/whatever`) and I'm logged out, after login I'm always sent to the dashboard, while it should bring to the page I called in the first place
This commit is contained in:
		@@ -185,8 +185,7 @@ class Admin
 | 
				
			|||||||
                    $grav = $this->grav;
 | 
					                    $grav = $this->grav;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    $this->setMessage($this->translate('PLUGIN_ADMIN.LOGIN_LOGGED_IN'), 'info');
 | 
					                    $this->setMessage($this->translate('PLUGIN_ADMIN.LOGIN_LOGGED_IN'), 'info');
 | 
				
			||||||
                    $redirect_route = $this->uri->route();
 | 
					                    $grav->redirect($form['redirect']);
 | 
				
			||||||
                    $grav->redirect($redirect_route);
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,9 +13,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        <form method="post" action="{{ base_url_relative }}">
 | 
					        <form method="post" action="{{ base_url_relative }}">
 | 
				
			||||||
            <div class="padding">
 | 
					            <div class="padding">
 | 
				
			||||||
            {% block form %}{% endblock %}
 | 
					                {% block form %}{% endblock %}
 | 
				
			||||||
 | 
					                <input type="hidden" name="redirect" value="{{ uri.url }}" />
 | 
				
			||||||
            {{ nonce_field('admin-form', 'admin-nonce') }}
 | 
					                {{ nonce_field('admin-form', 'admin-nonce') }}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </form>
 | 
					        </form>
 | 
				
			||||||
    </section>
 | 
					    </section>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user