@@ -298,16 +298,19 @@ def delete_user(id:)
298298 # @param [String] client_id The WorkOS client ID for the environment
299299 # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate.
300300 # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
301+ # @param [String] invitation_token The token of an Invitation, if required.
301302 # @param [Hash] session An optional hash that determines whether the session should be sealed and
302303 # the optional cookie password.
303304 #
304305 # @return WorkOS::AuthenticationResponse
306+ # rubocop:disable Metrics/ParameterLists
305307 def authenticate_with_password (
306308 email :,
307309 password :,
308310 client_id :,
309311 ip_address : nil ,
310312 user_agent : nil ,
313+ invitation_token : nil ,
311314 session : nil
312315 )
313316 validate_session ( session )
@@ -322,13 +325,15 @@ def authenticate_with_password(
322325 password : password ,
323326 ip_address : ip_address ,
324327 user_agent : user_agent ,
328+ invitation_token : invitation_token ,
325329 grant_type : 'password' ,
326330 } ,
327331 ) ,
328332 )
329333
330334 WorkOS ::AuthenticationResponse . new ( response . body , session )
331335 end
336+ # rubocop:enable Metrics/ParameterLists
332337
333338 # Authenticate a user using OAuth or an organization's SSO connection.
334339 #
@@ -337,6 +342,7 @@ def authenticate_with_password(
337342 # @param [String] client_id The WorkOS client ID for the environment
338343 # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate.
339344 # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
345+ # @param [String] invitation_token The token of an Invitation, if required.
340346 # @param [Hash] session An optional hash that determines whether the session should be sealed and
341347 # the optional cookie password.
342348 #
@@ -346,6 +352,7 @@ def authenticate_with_code(
346352 client_id :,
347353 ip_address : nil ,
348354 user_agent : nil ,
355+ invitation_token : nil ,
349356 session : nil
350357 )
351358 validate_session ( session )
@@ -359,6 +366,7 @@ def authenticate_with_code(
359366 client_secret : WorkOS . config . key! ,
360367 ip_address : ip_address ,
361368 user_agent : user_agent ,
369+ invitation_token : invitation_token ,
362370 grant_type : 'authorization_code' ,
363371 } ,
364372 ) ,
@@ -415,6 +423,7 @@ def authenticate_with_refresh_token(
415423 # @param [String] link_authorization_code Used to link an OAuth profile to an existing user,
416424 # after having completed a Magic Code challenge.
417425 # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate.
426+ # @param [String] invitation_token The token of an Invitation, if required.
418427 # @param [Hash] session An optional hash that determines whether the session should be sealed and
419428 # the optional cookie password.
420429 #
@@ -427,6 +436,7 @@ def authenticate_with_magic_auth(
427436 ip_address : nil ,
428437 user_agent : nil ,
429438 link_authorization_code : nil ,
439+ invitation_token : nil ,
430440 session : nil
431441 )
432442 validate_session ( session )
@@ -443,6 +453,7 @@ def authenticate_with_magic_auth(
443453 user_agent : user_agent ,
444454 grant_type : 'urn:workos:oauth:grant-type:magic-auth:code' ,
445455 link_authorization_code : link_authorization_code ,
456+ invitation_token : invitation_token ,
446457 } ,
447458 ) ,
448459 )
0 commit comments