Method: SignInService::Client::Session#logout

Defined in:
lib/sign_in_service/client/session.rb

#logout(access_token:, anti_csrf_token: nil) ⇒ Faraday::Response

Destroys the user session associated with the access token.

Parameters:

  • access_token (String)

    Access token of session to logout of

  • anti_csrf_token (String) (defaults to: nil)

    Optional token if enabled on client

Returns:

  • (Faraday::Response)

    Empty body with a 200 status



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/sign_in_service/client/session.rb', line 19

def logout(access_token:, anti_csrf_token: nil)
  connection.get(LOGOUT_PATH) do |req|
    req.params[:client_id] = client_id
    if cookie_auth?
      req.headers = cookie_header({ access_token:, anti_csrf_token: })
    else
      req.params[:anti_csrf_token] = anti_csrf_token
      req.headers = api_header(access_token)
    end
  end
end