Skip to content

Commit f68dd6e

Browse files
committed
feat: address comments and run prettier
1 parent a000402 commit f68dd6e

File tree

6 files changed

+18
-26
lines changed

6 files changed

+18
-26
lines changed

examples/react-components/src/app/dashboard/page.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function Dashboard() {
5656
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
5757
const [isPasskeyModalOpen, setIsPasskeyModalOpen] = useState(false);
5858
const [messageToSign, setMessageToSign] = useState(
59-
"Signing within Turnkey Demo."
59+
"Signing within Turnkey Demo.",
6060
);
6161
const [signature, setSignature] = useState<any>(null);
6262
const [suborgId, setSuborgId] = useState<string>("");
@@ -452,19 +452,19 @@ export default function Dashboard() {
452452
signature.r,
453453
signature.s,
454454
signature.v,
455-
selectedAccount!
455+
selectedAccount!,
456456
)
457457
: verifySolSignatureWithAddress(
458458
messageToSign,
459459
signature.r,
460460
signature.s,
461-
selectedAccount!
461+
selectedAccount!,
462462
);
463463

464464
setMessageSigningResult(
465465
verificationPassed
466466
? "Verified! The address used to sign the message matches your wallet address."
467-
: "Verification failed."
467+
: "Verification failed.",
468468
);
469469
};
470470
if (loading) {
@@ -548,13 +548,13 @@ export default function Dashboard() {
548548
{user &&
549549
user.oauthProviders &&
550550
user.oauthProviders.some((provider: { issuer: string }) =>
551-
provider.issuer.toLowerCase().includes("google")
551+
provider.issuer.toLowerCase().includes("google"),
552552
) && <span className="loginMethodDetails">{}</span>}
553553
</div>
554554
{user &&
555555
user.oauthProviders &&
556556
user.oauthProviders.some((provider: { issuer: string }) =>
557-
provider.issuer.toLowerCase().includes("google")
557+
provider.issuer.toLowerCase().includes("google"),
558558
) ? (
559559
<CheckCircleIcon sx={{ color: "#4c48ff" }} />
560560
) : (
@@ -571,7 +571,7 @@ export default function Dashboard() {
571571
{user &&
572572
user.oauthProviders &&
573573
user.oauthProviders.some((provider: { issuer: string }) =>
574-
provider.issuer.toLowerCase().includes("apple")
574+
provider.issuer.toLowerCase().includes("apple"),
575575
) ? (
576576
<CheckCircleIcon sx={{ color: "#4c48ff" }} />
577577
) : (
@@ -588,7 +588,7 @@ export default function Dashboard() {
588588
{user &&
589589
user.oauthProviders &&
590590
user.oauthProviders.some((provider: { issuer: string }) =>
591-
provider.issuer.toLowerCase().includes("facebook")
591+
provider.issuer.toLowerCase().includes("facebook"),
592592
) ? (
593593
<CheckCircleIcon sx={{ color: "#4c48ff" }} />
594594
) : (
@@ -664,7 +664,7 @@ export default function Dashboard() {
664664
account.addressFormat === "ADDRESS_FORMAT_ETHEREUM"
665665
? `https://etherscan.io/address/${account.address}`
666666
: `https://solscan.io/account/${account.address}`,
667-
"_blank"
667+
"_blank",
668668
)
669669
}
670670
style={{
@@ -681,7 +681,7 @@ export default function Dashboard() {
681681
)}
682682
<span className="accountAddress">{`${account.address.slice(
683683
0,
684-
5
684+
5,
685685
)}...${account.address.slice(-5)}`}</span>
686686
<LaunchIcon className="launchIcon" />
687687
</div>

packages/sdk-browser/src/__clients__/browser-clients.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
169169
// Throw an error if the client is not an iframe client
170170
throw new Error(
171171
"You must use an iframe client to refresh a read-write session",
172-
);
172+
);
173173
}
174174
await storeSession(session, AuthClient.Iframe);
175175
}

packages/sdk-browser/src/__types__/base.ts

-7
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ export type TurnkeySDKClientConfig =
9393
| SDKClientConfigWithStamper
9494
| SDKClientConfigWithReadOnlySession;
9595

96-
export interface TurnkeySDKClientPasskeyIframeConfig
97-
extends BaseSDKClientConfig {
98-
stamper: TStamper;
99-
iframeStamper: IframeStamper;
100-
passkeyStamper: WebauthnStamper;
101-
}
102-
10396
export interface TurnkeySDKBrowserConfig {
10497
apiBaseUrl: string;
10598
defaultOrganizationId: string;

packages/sdk-browser/src/sdk-client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class TurnkeyBrowserSDK {
124124
});
125125

126126
await this.stamper.init(
127-
params.dangerouslyOverrideIframeKeyTtl ?? undefined
127+
params.dangerouslyOverrideIframeKeyTtl ?? undefined,
128128
);
129129

130130
return new TurnkeyIframeClient({

packages/sdk-browser/src/storage.ts

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export const removeStorageValue = async <K extends StorageKeys>(
8585
*/
8686

8787
export const storeSession = async (session: Session, client: AuthClient) => {
88-
// TODO: rename and remove saveSession
8988
await setStorageValue(StorageKeys.Session, session);
9089
await setStorageValue(StorageKeys.Client, client);
9190
};

packages/sdk-react/src/components/auth/Auth.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ const Auth: React.FC<AuthProps> = ({
139139

140140
const handleAuthSuccess = async (
141141
credentialBundle: any,
142-
expirationSeconds?: string
142+
expirationSeconds?: string,
143143
) => {
144144
if (credentialBundle) {
145145
await authIframeClient!.injectCredentialBundle(credentialBundle);
146146
await authIframeClient!.loginWithAuthBundle(
147147
credentialBundle,
148-
expirationSeconds
148+
expirationSeconds,
149149
);
150150
await onAuthSuccess();
151151
}
@@ -195,7 +195,7 @@ const Auth: React.FC<AuthProps> = ({
195195
await passkeyClient?.loginWithPasskey(
196196
SessionType.READ_WRITE,
197197
authIframeClient!,
198-
authIframeClient?.iframePublicKey!
198+
authIframeClient?.iframePublicKey!,
199199
);
200200
router.push("/dashboard");
201201
} catch {
@@ -208,7 +208,7 @@ const Auth: React.FC<AuthProps> = ({
208208
await passkeyClient?.loginWithPasskey(
209209
SessionType.READ_WRITE,
210210
authIframeClient!,
211-
authIframeClient?.iframePublicKey!
211+
authIframeClient?.iframePublicKey!,
212212
);
213213
router.push("/dashboard");
214214
} catch (error) {
@@ -219,7 +219,7 @@ const Auth: React.FC<AuthProps> = ({
219219
const handleOtpLogin = async (
220220
type: FilterType.Email | FilterType.PhoneNumber,
221221
value: string,
222-
otpType: string
222+
otpType: string,
223223
) => {
224224
const createSuborgData: Record<string, any> = {};
225225
if (type === FilterType.Email) createSuborgData.email = value;
@@ -334,7 +334,7 @@ const Auth: React.FC<AuthProps> = ({
334334
if (sessionResponse?.credentialBundle) {
335335
await handleAuthSuccess(
336336
sessionResponse.credentialBundle,
337-
authConfig.sessionLengthSeconds?.toString()
337+
authConfig.sessionLengthSeconds?.toString(),
338338
);
339339
} else {
340340
throw new Error(authErrors.wallet.loginFailed);

0 commit comments

Comments
 (0)