I would to redirect to sign-in page when sign-out instead of redirect to homepage in github.
Any idea how I can do with an userscript? I would be grateful for assistance.
Here is how the form snippet look:
<ul>
<li class="header-nav-item">
<form accept-charset="UTF-8" action="/logout" class="logout-form" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
<input name="authenticity_token" type="hidden" value="123465789" />
</div>
<button class="header-nav-link sign-out-button tooltipped tooltipped-s" aria-label="Sign out" data-ga-click="Header, sign out, icon:logout"> <span class="octicon octicon-sign-out">Sign out</span>
</button>
</form>
</li>
</ul>
Here's some solution for Tampermonkey:
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
var myRedirectStorageKey = 'redirectMeToLogin';
if ( localStorage.getItem( myRedirectStorageKey ) ) {
localStorage.removeItem( myRedirectStorageKey );
window.location.href = 'https://github.com/login';
}
$( '.sign-out-button' ).on( 'click', function() {
localStorage.setItem( myRedirectStorageKey, true );
} );