mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
Filter github providers.
This commit is contained in:
@ -30,6 +30,23 @@ export function initServerUrl() {
|
||||
}
|
||||
}
|
||||
|
||||
function isLocalhost() {
|
||||
const hostname = window.location.hostname;
|
||||
return hostname === "localhost";
|
||||
}
|
||||
|
||||
export function isProviderVisible(provider) {
|
||||
if (provider.type !== "GitHub") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isLocalhost()) {
|
||||
return provider.name.includes("localhost");
|
||||
} else {
|
||||
return !provider.name.includes("localhost");
|
||||
}
|
||||
}
|
||||
|
||||
export function parseJson(s) {
|
||||
if (s === "") {
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user