Created
August 11, 2022 21:01
-
-
Save nukedbit/9f6723cf0680abf408c12e6c3972be0e to your computer and use it in GitHub Desktop.
ServiceStack login meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomCredentialProvider: CredentialsAuthProvider,IAuthResponseFilter | |
{ | |
public CustomCredentialProvider(IAppSettings appSettings):base(appSettings) | |
{ | |
} | |
public async Task ExecuteAsync(AuthFilterContext authContext) | |
{ | |
var db = HostContext.AppHost.GetDbConnection(authContext.Request); | |
var userId = Convert.ToInt32(authContext.Session.UserAuthId); | |
var user = await db.SingleAsync<sstestauth.AppUser>(x => x.Id == userId); | |
authContext.AuthResponse.Meta = user.Meta; | |
} | |
public Task ResultFilterAsync(AuthResultContext authContext, CancellationToken token = new CancellationToken()) | |
{ | |
throw new NotImplementedException(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment