toSession()
toSession(
parsed,verificationMethod?):SiwxSession
Defined in: siwx-server/src/types.ts:426
Converts a verified CAIP-122 message into a SiwxSession: keeps address, chainId, domain, nonce,
issuedAt and expirationTime, plus verificationMethod when given. Pure function.
Parameters
parsed
The verified message, for example result.data of verifySiwxPayload.
verificationMethod?
How the signature was verified: result.method of verifySiwxPayload. Without
it, siwxJwtSubject keeps the chain in the subject of an EVM session.
Returns
The session object to store or sign.
Example
const result = await verifySiwxPayload(payload, { policy });
if (result.success && result.data) {
const session = toSession(result.data, result.method);
}Last updated on