@farcaster/auth-client
Advanced tools
Comparing version
@@ -134,2 +134,6 @@ import { SiweMessage, SiweResponse } from 'siwe'; | ||
}; | ||
metadata: { | ||
ip: string; | ||
userAgent: string; | ||
}; | ||
} | ||
@@ -190,3 +194,3 @@ declare const status: (client: Client, { channelToken }: StatusArgs) => StatusResponse; | ||
channelToken: string; | ||
params: Partial<SignInMessageParams> & { | ||
params?: Partial<SignInMessageParams> & { | ||
redirectUrl?: string; | ||
@@ -193,0 +197,0 @@ }; |
@@ -361,13 +361,17 @@ "use strict"; | ||
} | ||
if (!params["nonce"]) { | ||
return (0, import_neverthrow4.err)(validationFail("No nonce provided")); | ||
if (params["nonce"] || params["siweUri"] || params["domain"]) { | ||
if (!params["nonce"]) { | ||
return (0, import_neverthrow4.err)(validationFail("No nonce provided")); | ||
} | ||
if (!params["siweUri"]) { | ||
return (0, import_neverthrow4.err)(validationFail("No SIWE URI provided")); | ||
} | ||
if (!params["domain"]) { | ||
return (0, import_neverthrow4.err)(validationFail("No domain provided")); | ||
} | ||
const { siweUri, ...siweParams } = params; | ||
return (0, import_neverthrow4.ok)({ channelToken, params: { uri: siweUri, ...siweParams } }); | ||
} else { | ||
return (0, import_neverthrow4.ok)({ channelToken }); | ||
} | ||
if (!params["siweUri"]) { | ||
return (0, import_neverthrow4.err)(validationFail("No SIWE URI provided")); | ||
} | ||
if (!params["domain"]) { | ||
return (0, import_neverthrow4.err)(validationFail("No domain provided")); | ||
} | ||
const { siweUri, ...siweParams } = params; | ||
return (0, import_neverthrow4.ok)({ channelToken, params: { uri: siweUri, ...siweParams } }); | ||
}; | ||
@@ -374,0 +378,0 @@ var validationFail = (message) => { |
{ | ||
"name": "@farcaster/auth-client", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
106098
0.42%3610
0.33%