Jak przekierować po uwierzytelnieniu w ServiceStack

Przesłoniłem CredentialsAuthProvider w ten sposób:

public override bool TryAuthenticate(IServiceBase authService, string userName, string password)
        {
            //TODO: Auth the user and return if valid login
            return true;
        }

public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IOAuthTokens tokens, Dictionary<string, string> authInfo)
        {
            base.OnAuthenticated(authService, session, tokens, authInfo);

            //User has been authenticated

            //Find the user's role form the DB

            if (roleA)
                //GOTO mypage1

            if (roleB)
                //GOTO mypage2
        }

Wykonuję prosty post do ~ / auth / Credentials i podczas gdy uwierzytelnianie działa i wywoływana jest metoda OnAuthenticated, jak właściwie przekierować użytkownika do odpowiedniej strony w oparciu o rolę lub coś podobnego?

Zmęczyłem się wykonywać następujące czynności w metodzie OnAuthenticated, ale nie przyniósł pożądanego efektu:

authService. („/ views / clients”);

Aktualizacja przy użyciu szablonu startowego (patrz komentarz poniżej):

public class CustomCredentialsAuthProvider : CredentialsAuthProvider
    {
        public override bool TryAuthenticate(IServiceBase authService, string userName, string password)
        {
            return true;
        }

        public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IOAuthTokens tokens, Dictionary<string, string> authInfo)
        {
            session.ReferrerUrl = "http://www.msn.com";

            base.OnAuthenticated(authService, session, tokens, authInfo);
        }
    }

I formularz POST:

<form method="POST" action="/auth/credentials">
        <input name="UserName"/>
        <input name="Password" type="password"/>
        <input type="submit"/>
    </form>

questionAnswers(2)

yourAnswerToTheQuestion