简体   繁体   中英

Chargebee Portal Session API includes a redirect_url for when user logs out. From their UI I can't see how the user can logout?

Implementing Chargebee Portal Session integrating it into my app. If the users subscription is inactive, Im redirecting them to the portal to update their subscription.

The API provides:

redirect_url
URL to redirect when the user logs out from the portal.

My (ruby) code is like this, matches the example in the API :

result = ChargeBee::PortalSession.create({
      :customer => {
        :redirect_url => current_lessons_url,
        :id => chargebee_customer_token
        }
      })

I get the portal loading just fine.. but how does the user logout.. and trigger the return to my app? I can't see it.

Here's how it looks for me. How does the user logout and initate a return to my app?

在此处输入图像描述

Assuming that you are using SSO via API portal auth setup, In order to handle the Logout scenario, you can call Chargebee's Logout a portal session API endpoint and pass the respective portal session ID from which the user is trying to log out. So on logout call, the redirect URL passed in the create function is used and the end-user is redirected to the specified URL destination/app.

Reference - https://apidocs.chargebee.com/docs/api/portal_sessions?lang=ruby#logout_a_portal_session

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM