DiscourseConnect provider does not redirect to return_url after entering correct id and password

i have followed steps to enable DiscourseConnect Provider. when i redirect a user to

http://localhost:4200/session/sso_provider?sso=${URL_ENCODED_PAYLOAD}&sig=${HEX_SIGNATURE}

it will take me to discourse login dialog popup. I wrote username and password correctly but when i click submit it closes the dialog but does not redirect me back to the return url.

Note: when i create new account, in that case i am redirected back however when i already have account and want to login, I am not redirected back.

Please help

I’ve moved this to #support for now since this post does not include complete information to reproduce the behavior.