• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

How can I redirect user to a URL after successful Logout?

Scheduled Pinned Locked Moved NodeBB Development
ssoredirect
7 Posts 5 Posters 3.6k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Dustin FalgoutD Offline
    Dustin FalgoutD Offline
    Dustin Falgout
    wrote on last edited by
    #1

    I'm using an SSO plugin that I created based on the current Github SSO plugin. I have disabled local login so login will be through my SSO plugin only. I need to redirect the user to a special logout URL after they logout of nodebb so that it logs them out of our SSO service. Is it possible to do through a filter or action?

    @baris @psychobunny @julian (sorry hehe 😉)

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #2

    app.logout is the global method that handles the logout code on the client side

    You can override this method and run your own code.

    ... actually, looking at that, it might not work...

    Try this instead:

    components.get('user/logout').off('click').on('click', function() {
        // your custom behaviour here
    });
    
    livey0uL 1 Reply Last reply
    0
  • bitspookB Offline
    bitspookB Offline
    bitspook Gamers
    wrote on last edited by bitspook
    #3

    interstitial launch based on intent?

    Not exactly what you were looking for, but a workaround to show an arbitrary URL.

    something like:
    https://github.com/brettdewoody/jQuery-Interstitial
    (lost track of the one that I had set aside with intent built-in.)

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #4

    @Dustin-Falgout You probably have to do both of the things I listed above.

    Overriding app.logout is useful because app.logout is still called in certain places. The .off().on() bit just re-maps the logout link to the new method 🙂

    Dustin FalgoutD 1 Reply Last reply
    1
  • Dustin FalgoutD Offline
    Dustin FalgoutD Offline
    Dustin Falgout
    replied to julian on last edited by Dustin Falgout
    #5

    @julian Thanks for the advice. I will give it a try asap and then let you know how it goes!

    Edit: Thanks for your input as well @bitspook (didn't mean to be rude 😬 )

    1 Reply Last reply
    1
  • livey0uL Offline
    livey0uL Offline
    livey0u
    replied to julian on last edited by
    #6

    @julian I am building a theme & like to override the logout behaviour. It would be great, if you could tell me how components becomes available?

    barisB 1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    replied to livey0u on last edited by
    #7

    @livey0u It is just a requirejs module so just require it.

    require(['components'], function (components) {
        components.get('user/logout').off('click').on('click', function() {
          // your custom behaviour here
        });
    });
    
    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development