简体   繁体   中英

How do I pass a RefId to the UserAuthDetail table in Servicestack?

I see that servicestack supports passing an int? RefId and string RefString in both the Userauth table and the UserAuthDetail table. I have hooked up my sign-up/sign-in process to facebook, but when it tries to add the user I get an error telling me that RefID can't be null? The UserAuthDetail table was created with "Allow Nulls" set to false on that column and no default value supplied. The UserAuth table is set to "allows null" on that column.

How do I pass a refid to the signup process? I know that there is some way to pass it on the querystring but I don't now how to get in the middle of the OAuth transaction. Is there some method I can override?

Should I just change the table?

The RefId is a int? column which OrmLite creates allowing null as expected. I'd leave the properties on any POCO's you don't control to reflect the underlying RDBMS schema otherwise you'll run into runtime issues like this.

You can use the OnAuthenticated()/OnRegistered() Session or Auth Events to customize what data is stored in the underlying UserAuth table using a Custom UserSession OnAuthenticated event .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM