How to hide custom login and register button

I’m using sso on my discourse and i have added custom header menu, in which i have shown 2 links
1 - Register
2 - Login

if the user is logged in. then register and login menu should hide and logout button should be shown.

I also want to pass the Login sso parameters to that custom login link.

How can i achieve this