From da1d6a3b15166f8998c93479eb11d060ca025e3f Mon Sep 17 00:00:00 2001 From: etaylormcgregor-stytch Date: Mon, 29 Jul 2024 14:27:51 -0400 Subject: [PATCH] [AUTH-3740] Sessions migrate endpoint (#132) * Retired Emails * Minor version bump. * Remove OAuth tenant code. * Include docs fix * sessions migrate * re gen-all --------- Co-authored-by: Jack Cook Co-authored-by: Evelyn Taylor-McGregor --- lib/stytch/sessions.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/stytch/sessions.rb b/lib/stytch/sessions.rb index a2b4540..68099ea 100644 --- a/lib/stytch/sessions.rb +++ b/lib/stytch/sessions.rb @@ -156,6 +156,21 @@ def revoke( post_request('/v1/sessions/revoke', request, headers) end + def migrate( + session_token:, + session_duration_minutes: nil, + session_custom_claims: nil + ) + headers = {} + request = { + session_token: session_token + } + request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil? + request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil? + + post_request('/v1/sessions/migrate', request, headers) + end + # Get the JSON Web Key Set (JWKS) for a project. # # JWKS are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key set, and both key sets will be returned by this endpoint for a period of 1 month.