Web: Added a request for all users regardless of user rights.
This commit is contained in:
parent
314ed6be15
commit
99447cfc7b
@ -19,12 +19,17 @@ import { StyledWrapper } from "./styled-social-networks";
|
|||||||
|
|
||||||
const SocialNetworks = (props) => {
|
const SocialNetworks = (props) => {
|
||||||
const { t } = useTranslation(["Profile", "Common"]);
|
const { t } = useTranslation(["Profile", "Common"]);
|
||||||
const { providers, setProviders, isOAuthAvailable, setPortalQuota } = props;
|
const {
|
||||||
|
providers,
|
||||||
|
setProviders,
|
||||||
|
isOAuthAvailable,
|
||||||
|
//setPortalQuota
|
||||||
|
} = props;
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const data = await getAuthProviders();
|
const data = await getAuthProviders();
|
||||||
if (typeof isOAuthAvailable === "undefined") await setPortalQuota();
|
//if (typeof isOAuthAvailable === "undefined") await setPortalQuota();
|
||||||
setProviders(data);
|
setProviders(data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@ -43,7 +48,7 @@ const SocialNetworks = (props) => {
|
|||||||
const tokenGetterWin = window.open(
|
const tokenGetterWin = window.open(
|
||||||
link,
|
link,
|
||||||
"login",
|
"login",
|
||||||
"width=800,height=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no"
|
"width=800,height=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no",
|
||||||
);
|
);
|
||||||
|
|
||||||
const code = await getOAuthToken(tokenGetterWin);
|
const code = await getOAuthToken(tokenGetterWin);
|
||||||
@ -52,7 +57,7 @@ const SocialNetworks = (props) => {
|
|||||||
auth: providerName,
|
auth: providerName,
|
||||||
mode: "popup",
|
mode: "popup",
|
||||||
callback: "loginCallback",
|
callback: "loginCallback",
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
tokenGetterWin.location.href = getLoginLink(token, code);
|
tokenGetterWin.location.href = getLoginLink(token, code);
|
||||||
@ -141,12 +146,15 @@ export default inject(({ currentQuotaStore, peopleStore }) => {
|
|||||||
const { usersStore } = peopleStore;
|
const { usersStore } = peopleStore;
|
||||||
const { providers, setProviders } = usersStore;
|
const { providers, setProviders } = usersStore;
|
||||||
|
|
||||||
const { isOAuthAvailable, setPortalQuota } = currentQuotaStore;
|
const {
|
||||||
|
isOAuthAvailable,
|
||||||
|
//setPortalQuota
|
||||||
|
} = currentQuotaStore;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
providers,
|
providers,
|
||||||
setProviders,
|
setProviders,
|
||||||
isOAuthAvailable,
|
isOAuthAvailable,
|
||||||
setPortalQuota,
|
// setPortalQuota,
|
||||||
};
|
};
|
||||||
})(observer(SocialNetworks));
|
})(observer(SocialNetworks));
|
||||||
|
@ -141,7 +141,7 @@ class AuthStore {
|
|||||||
) {
|
) {
|
||||||
requests.push(
|
requests.push(
|
||||||
this.userStore?.init(i18n).then(() => {
|
this.userStore?.init(i18n).then(() => {
|
||||||
if (this.isQuotaAvailable && !isPortalRestore) {
|
if (!isPortalRestore) {
|
||||||
this.getTenantExtra();
|
this.getTenantExtra();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@ -273,13 +273,13 @@ class AuthStore {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isQuotaAvailable() {
|
// get isQuotaAvailable() {
|
||||||
const user = this.userStore?.user;
|
// const user = this.userStore?.user;
|
||||||
|
|
||||||
if (!user) return false;
|
// if (!user) return false;
|
||||||
|
|
||||||
return user.isOwner || user.isAdmin || this.isRoomAdmin;
|
// return user.isOwner || user.isAdmin || this.isRoomAdmin;
|
||||||
}
|
// }
|
||||||
|
|
||||||
get isPaymentPageAvailable() {
|
get isPaymentPageAvailable() {
|
||||||
const user = this.userStore?.user;
|
const user = this.userStore?.user;
|
||||||
|
Loading…
Reference in New Issue
Block a user