Redirect after login one like logout redirect

Something Like SSO but i want to use discourse login mechanism.