Skip to content

Commit 3f037d7

Browse files
authored
feat: close the loop on allowing multiple loginUri validations (#292)
Missed a couple of spots in the last PR (#291) that added support for validating login payloads against a list of allowable URIs.
1 parent 0b9a133 commit 3f037d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libraries/js/src/response.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export function hasChainSubmissions(result: SiwfResponse): boolean {
2424
* Validate a possible SIWF Response
2525
*
2626
* @param {unknown} response - A possible SIWF Response.
27-
* @param {string} loginMsgUri - The login message signed by the user should match this domain. (Default: localhost)
27+
* @param {string | string[]} loginMsgUri - The login message signed by the user should match one of the supplied domains. (Default: localhost)
2828
*
2929
* @returns {Promise<SiwfResponse>} The validated response
3030
*/
31-
export async function validateSiwfResponse(response: unknown, loginMsgUri: string): Promise<SiwfResponse> {
31+
export async function validateSiwfResponse(response: unknown, loginMsgUri: string | string[]): Promise<SiwfResponse> {
3232
await cryptoWaitReady();
3333

3434
let body = response;

libraries/js/src/types/general.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { validateAddress } from '@polkadot/util-crypto/address/validate';
22

33
export interface SiwfOptions {
44
endpoint: string;
5-
loginMsgUri?: string;
5+
loginMsgUri?: string | string[];
66
}
77

88
export interface SiwfPublicKey {

0 commit comments

Comments
 (0)