From ae16762026b76bbc35f113def62c3a925ad416a4 Mon Sep 17 00:00:00 2001 From: Max Gerber <89937743+Max-Stytch@users.noreply.github.com> Date: Fri, 20 May 2022 15:46:57 -0700 Subject: [PATCH] feat: Add user object to update and authenticate responses (#72) --- stytch/config/config.go | 2 +- stytch/cryptowallet.go | 1 + stytch/magiclink.go | 1 + stytch/otp.go | 1 + stytch/session.go | 1 + stytch/totp.go | 2 ++ stytch/user.go | 7 +++++++ stytch/webauthn.go | 1 + 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stytch/config/config.go b/stytch/config/config.go index 16a2c3c9..e75551b7 100644 --- a/stytch/config/config.go +++ b/stytch/config/config.go @@ -1,6 +1,6 @@ package config -const APIVersion = "5.4.2" +const APIVersion = "5.5.0" type BaseURI string diff --git a/stytch/cryptowallet.go b/stytch/cryptowallet.go index 2caa6047..5f7c207f 100644 --- a/stytch/cryptowallet.go +++ b/stytch/cryptowallet.go @@ -30,4 +30,5 @@ type CryptoWalletAuthenticateResponse struct { SessionToken string `json:"session_token,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` Session Session `json:"session,omitempty"` + User User `jspon:"user,omitempty"` } diff --git a/stytch/magiclink.go b/stytch/magiclink.go index 26ffab79..42e54446 100644 --- a/stytch/magiclink.go +++ b/stytch/magiclink.go @@ -30,6 +30,7 @@ type MagicLinksAuthenticateResponse struct { SessionToken string `json:"session_token,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` Session Session `json:"session,omitempty"` + User User `jspon:"user,omitempty"` } // MAGIC LINK - EMAIL diff --git a/stytch/otp.go b/stytch/otp.go index e5141fb9..68f33a0d 100644 --- a/stytch/otp.go +++ b/stytch/otp.go @@ -18,6 +18,7 @@ type OTPsAuthenticateResponse struct { SessionToken string `json:"session_token,omitempty"` Session Session `json:"session,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` + User User `jspon:"user,omitempty"` } // OTP - SMS diff --git a/stytch/session.go b/stytch/session.go index 86b41016..e00a04da 100644 --- a/stytch/session.go +++ b/stytch/session.go @@ -47,6 +47,7 @@ type SessionsAuthenticateResponse struct { Session Session `json:"session,omitempty"` SessionToken string `json:"session_token,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` + User User `jspon:"user,omitempty"` } type SessionsRevokeParams struct { diff --git a/stytch/totp.go b/stytch/totp.go index 6fd23c70..e049d496 100644 --- a/stytch/totp.go +++ b/stytch/totp.go @@ -36,6 +36,7 @@ type TOTPsAuthenticateResponse struct { SessionToken string `json:"session_token,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` Session Session `json:"session,omitempty"` + User User `jspon:"user,omitempty"` } type TOTPsRecoveryCodesParams struct { @@ -65,4 +66,5 @@ type TOTPsRecoverResponse struct { SessionToken string `json:"session_token,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` Session Session `json:"session,omitempty"` + User User `jspon:"user,omitempty"` } diff --git a/stytch/user.go b/stytch/user.go index e729434b..9aa98dbd 100644 --- a/stytch/user.go +++ b/stytch/user.go @@ -78,6 +78,7 @@ type UsersCreateResponse struct { EmailID string `json:"email_id,omitempty"` PhoneID string `json:"phone_id,omitempty"` Status string `json:"status,omitempty"` + User User `jspon:"user,omitempty"` } type UsersGetResponse struct { @@ -110,6 +111,7 @@ type UsersUpdateResponse struct { Emails []Email `json:"emails,omitempty"` PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` CryptoWallets []CryptoWallet `json:"crypto_wallets,omitempty"` + User User `jspon:"user,omitempty"` } type UsersDeleteResponse struct { @@ -122,30 +124,35 @@ type UsersDeleteEmailResponse struct { RequestID string `json:"request_id,omitempty"` StatusCode int `json:"status_code,omitempty"` UserID string `json:"user_id,omitempty"` + User User `jspon:"user,omitempty"` } type UsersDeletePhoneNumberResponse struct { RequestID string `json:"request_id,omitempty"` StatusCode int `json:"status_code,omitempty"` UserID string `json:"user_id,omitempty"` + User User `jspon:"user,omitempty"` } type UsersDeleteWebAuthnRegistrationResponse struct { RequestID string `json:"request_id,omitempty"` StatusCode int `json:"status_code,omitempty"` UserID string `json:"user_id,omitempty"` + User User `jspon:"user,omitempty"` } type UsersDeleteTOTPResponse struct { RequestID string `json:"request_id,omitempty"` StatusCode int `json:"status_code,omitempty"` UserID string `json:"user_id,omitempty"` + User User `jspon:"user,omitempty"` } type UsersDeleteCryptoWalletResponse struct { RequestID string `json:"request_id,omitempty"` StatusCode int `json:"status_code,omitempty"` UserID string `json:"user_id,omitempty"` + User User `jspon:"user,omitempty"` } /* User Search */ diff --git a/stytch/webauthn.go b/stytch/webauthn.go index 47443e55..2867d29b 100644 --- a/stytch/webauthn.go +++ b/stytch/webauthn.go @@ -53,4 +53,5 @@ type WebAuthnAuthenticateResponse struct { SessionToken string `json:"session_token,omitempty"` SessionJWT string `json:"session_jwt,omitempty"` Session Session `json:"session,omitempty"` + User User `jspon:"user,omitempty"` }