Skip to content

Commit e47a579

Browse files
committed
chore: remove logs and comments
1 parent 65f2e68 commit e47a579

File tree

3 files changed

+26
-31
lines changed

3 files changed

+26
-31
lines changed

src/components/AuthLogin/AuthModal.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import {
1414
AUTH_WALLET_SESSION_NAME,
1515
AUTH_WALLET_USER_PLAN,
1616
} from "@site/src/lib/siwsrp/auth";
17-
import { REQUEST_PARAMS } from "@site/src/lib/constants";
17+
import {
18+
REQUEST_PARAMS,
19+
} from "@site/src/lib/constants";
1820
import { MetamaskProviderContext } from "@site/src/theme/Root";
1921

2022
Modal.setAppElement("#__docusaurus");
@@ -37,7 +39,7 @@ export enum AUTH_LOGIN_STEP {
3739
export enum WALLET_LINK_TYPE {
3840
NO = "NO",
3941
ONE = "ONE",
40-
MULTIPLE = "MULTIPLE",
42+
MULTIPLE = "MULTIPLE"
4143
}
4244

4345
const ConnectingModal = () => {
@@ -161,12 +163,9 @@ const AuthModal = ({
161163
const login = async () => {
162164
setStep(AUTH_LOGIN_STEP.CONNECTING);
163165
try {
164-
165-
// This will cause problems on mobile
166-
// check what this value is on mobile. Do we need to do something different?
167-
// if (!sdk.isExtensionActive()) {
168-
// setOpen(false);
169-
// }
166+
if (!sdk.isExtensionActive()) {
167+
setOpen(false);
168+
}
170169

171170
// Try to connect wallet first
172171
const accounts = await sdk.connect();
@@ -212,7 +211,7 @@ const AuthModal = ({
212211
mmAuthSession: sessionStorage.getItem(AUTH_WALLET_SESSION_NAME),
213212
walletPairing: data.pairing,
214213
token: true,
215-
})
214+
}),
216215
).toString("base64");
217216

218217
const walletAuthUrl = `${DASHBOARD_URL}/login?mm_auth=${mm_auth}&redirect_to=${session.redirect_to}`;
@@ -235,10 +234,10 @@ const AuthModal = ({
235234
if (data.mfa?.enabled) {
236235
const mm_auth = Buffer.from(
237236
JSON.stringify({
238-
step: "verify",
237+
step: 'verify',
239238
mmAuthSession: sessionStorage.getItem(AUTH_WALLET_SESSION_NAME),
240-
dashboardSessionToken: token,
241-
})
239+
dashboardSessionToken: token
240+
}),
242241
).toString("base64");
243242

244243
const walletAuthUrl = `${DASHBOARD_URL}/login?mm_auth=${mm_auth}&redirect_to=${session.redirect_to}`;
@@ -273,7 +272,7 @@ const AuthModal = ({
273272
`${DASHBOARD_URL}/api/v1/users/${userId}/projects`,
274273
{
275274
...REQUEST_PARAMS("GET", { Authorization: `Bearer ${token}` }),
276-
}
275+
},
277276
);
278277
const {
279278
result: { projects },
@@ -285,7 +284,7 @@ const AuthModal = ({
285284
`${DASHBOARD_URL}/api/v1/users/${userId}`,
286285
{
287286
...REQUEST_PARAMS("GET", { Authorization: `Bearer ${token}` }),
288-
}
287+
},
289288
);
290289
const {
291290
result: {

src/lib/siwsrp/auth.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,8 @@ export const authenticateAndAuthorize = async (env: string, customProvider: SDKP
7171
let accessToken: string, userProfile: SDK.UserProfile;
7272
try {
7373
const authInstance = auth(env);
74-
console.log("authInstance", authInstance);
75-
console.log("customProvider", customProvider);
7674
authInstance.setCustomProvider(customProvider);
77-
console.log('about to connectSnap')
7875
await authInstance.connectSnap();
79-
console.log('after connectSnap')
8076
accessToken = await authInstance.getAccessToken();
8177
userProfile = await authInstance.getUserProfile();
8278
} catch (e: any) {

src/theme/Root.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,28 @@ interface IMetamaskProviderContext {
7272
export const MetamaskProviderContext = createContext<IMetamaskProviderContext>({
7373
token: undefined,
7474
projects: {},
75-
setProjects: () => { },
76-
metaMaskDisconnect: () => new Promise(() => { }),
77-
metaMaskWalletIdConnectHandler: () => new Promise(() => { }),
75+
setProjects: () => {},
76+
metaMaskDisconnect: () => new Promise(() => {}),
77+
metaMaskWalletIdConnectHandler: () => new Promise(() => {}),
7878
userId: undefined,
7979
metaMaskAccount: undefined,
8080
metaMaskAccountEns: undefined,
81-
setMetaMaskAccount: () => { },
81+
setMetaMaskAccount: () => {},
8282
uksTier: undefined,
8383
metaMaskProvider: undefined,
84-
setMetaMaskProvider: () => { },
84+
setMetaMaskProvider: () => {},
8585
sdk: undefined,
86-
setNeedsMfa: () => { },
86+
setNeedsMfa: () => {},
8787
needsMfa: false,
88-
setWalletLinked: () => { },
88+
setWalletLinked: () => {},
8989
walletLinked: undefined,
90-
setWalletAuthUrl: () => { },
90+
setWalletAuthUrl: () => {},
9191
walletAuthUrl: "",
9292
userAPIKey: "",
93-
setUserAPIKey: () => { },
94-
fetchLineaEns: () => new Promise(() => { }),
93+
setUserAPIKey: () => {},
94+
fetchLineaEns: () => new Promise(() => {}),
9595
userEncPublicKey: undefined,
96-
setUserEncPublicKey: () => { },
96+
setUserEncPublicKey: () => {},
9797
});
9898

9999
const sdk = new MetaMaskSDK({
@@ -105,7 +105,7 @@ const sdk = new MetaMaskSDK({
105105
extensionOnly: true,
106106
checkInstallationImmediately: false,
107107
logging: {
108-
sdk: true,
108+
sdk: false,
109109
},
110110
});
111111

@@ -173,7 +173,7 @@ export const LoginProvider = ({ children }) => {
173173
const provider = sdk.getProvider();
174174
setMetaMaskProvider(provider);
175175
}
176-
} catch (e) { }
176+
} catch (e) {}
177177
};
178178

179179
const metaMaskWalletIdConnectHandler = useCallback(async () => {

0 commit comments

Comments
 (0)