How does the ServiceStack Auth redirect works?

103 Views Asked by At

I'm trying to follow the Bootstrap ServiceStack code from http://bootstrapapi.apphb.com/

I can register a new user, but soon I do everything I want (create a new user on my table that extends the UserAuth table) in the CreateUserAuth() method from my CustomUserAuth it redirects to http://localhost:50447/api/register

I want to go back to the Home Controller...

What is the simple way to accomplish this?

In the docs, under Authentication, this is not very explicit, and I'm using the latest version to date: v4.0.30 and I'm implementing a custom CredentialsAuthProvider.

1

There are 1 best solutions below

1
On

You can use the ?Continue=/path QueryString parameter to specify where it should redirect to.

If you're using your own custom UserAuth tables (i.e instead of integrating with the existing UserAuth tables) you should subclass OrmLiteAuthRepository<T,T> class including your custom POCO's, e.g see the source for OrmLiteAuthRepository:

public class OrmLiteAuthRepository 
    : OrmLiteAuthRepository<UserAuth, UserAuthDetails>, IUserAuthRepository
{
    public OrmLiteAuthRepository(IDbConnectionFactory dbFactory) 
        : base(dbFactory) { }
}