Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow only auth service urls to set loginId #348

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/core/auth.ts
Original file line number Diff line number Diff line change
@@ -144,6 +144,7 @@ export class Auth {
sessionNamespace: this.options.sessionNamespace,
sessionTime: this.options.sessionTime,
sessionId,
allowedOrigin: this.options.sdkUrl,
});

if (this.options.network === WEB3AUTH_NETWORK.TESTNET || this.options.network === WEB3AUTH_NETWORK.SAPPHIRE_DEVNET) {
@@ -430,6 +431,7 @@ export class Auth {
sessionNamespace: data.options.sessionNamespace,
sessionTime: timeout, // each login key must be used with 10 mins (might be used at the end of popup redirect)
sessionId: loginId,
allowedOrigin: this.options.sdkUrl,
});

const promise = loginSessionMgr.createSession(JSON.parse(JSON.stringify(data)));

Unchanged files with check annotations Beta

/**
* Error subclass implementing Ethereum Provider errors per EIP-1193.
* Permits integer error codes in the [ 1000 <= 4999 ] range.

Check warning on line 115 in src/jrpc/errors/error-classes.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-malformed-html-name: Invalid HTML element: Expecting an HTML name
*/
export class EthereumProviderError<Data extends OptionalDataWithOptionalCause> extends JsonRpcError<Data> {
/**
/**
* Get a JSON RPC 2.0 Server error.
* Permits integer error codes in the [ -32099 <= -32005 ] range.

Check warning on line 111 in src/jrpc/errors/errors.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-malformed-html-name: Invalid HTML element: Expecting an HTML name
* Codes -32000 through -32004 are reserved by EIP-1474.
*
* @param opts - The error options bag.
*
* @param error - The error to serialize.
* @param options - Options bag.
* @param options.fallbackError - The error to return if the given error is

Check warning on line 213 in src/jrpc/errors/utils.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* not compatible. Should be a JSON serializable value.
* @param options.shouldIncludeStack - Whether to include the error's stack

Check warning on line 215 in src/jrpc/errors/utils.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* on the returned object.
* @returns The serialized error.
*/
/**
* Language specific link for terms and conditions on torus-website. See (examples/vue-app) to configure
* e.g.
* tncLink: {

Check warning on line 339 in src/utils/interfaces.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
* en: "http://example.com/tnc/en",
* ja: "http://example.com/tnc/ja",
* }

Check warning on line 342 in src/utils/interfaces.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
*/
tncLink?: Partial<Record<LANGUAGE_TYPE, string>>;
/**
* Language specific link for privacy policy on torus-website. See (examples/vue-app) to configure
* e.g.
* privacyPolicy: {

Check warning on line 348 in src/utils/interfaces.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
* en: "http://example.com/tnc/en",
* ja: "http://example.com/tnc/ja",
* }

Check warning on line 351 in src/utils/interfaces.ts

GitHub Actions / test (20.x, ubuntu-latest)

tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
*/
privacyPolicy?: Partial<Record<LANGUAGE_TYPE, string>>;
};