Skip to content

Instantly share code, notes, and snippets.

@affix
Last active February 22, 2022 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save affix/0f37f44a82488ec4137de9a9a62c14c7 to your computer and use it in GitHub Desktop.
Save affix/0f37f44a82488ec4137de9a9a62c14c7 to your computer and use it in GitHub Desktop.
A greesemonkey/tampermonkey/*monkey script to automatically login to github orgs using SSO
// ==UserScript==
// @name Github Auto SSO
// @namespace Violentmonkey Scripts
// @match https://github.com/*
// @grant none
// @version 1.0.1
// @author Keiran Smith <opensource@keiran.scot>
// @description 26/07/2021, 09:05:17
// ==/UserScript==
var isSSOPage = window.location.href.indexOf("sso") > 0
document.querySelectorAll("a").forEach((d)=>{
if(/orgs\/.*\/sso/g.test(d.href) && !isSSOPage ) {
window.location.href = d.href;
}
})
if(isSSOPage) {
document.querySelector(".btn-primary").click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment