Hi Lakshman,
Could we not do this in the onUserLoggedIn callback itself after checking if the logged in user already has the subscriber role or not? Thank You, Sameera On Mon, Jul 20, 2015 at 6:10 AM, Lakshman Udayakantha <lakshm...@wso2.com> wrote: > Couldn't add onLogin function is used in extension in previous mail. sorry > for that. find it below. > > onUserLoggedIn : function(){ > var userName=ctx.username; > var apistore = require('apistore').apistore.instance(userName); > var subscriber=apistore.getSubscriber(userName); > if(!subscriber){ > apistore.addSubscriber(userName,ctx.tenantId); > } > }, > > additionally, found below function > > event.on('userRegister', function (tenantId, user) { > log.info("user registering..................................."); > configs(tenantId).userRoles.forEach(function (role) { > if (user.hasRoles([role])) { > return; > } > user.addRoles([role]); > }); > }); > > It should be call on user signup. But it calls on first login for the > users who signed up. Any way I can't change that function to add subscriber > role to users because this function found in store/module/store.js file > which is not in extension directory. simply this function reside in ES code > and adding subscriber role to users should happen in extension because that > functionality is specific to API store. > > Thanks > > On Mon, Jul 20, 2015 at 3:05 PM, Lakshman Udayakantha <lakshm...@wso2.com> > wrote: > >> Hi Sameera/ES Team, >> >> I am working on [1]. I want to add to users who sign up in store, the >> subscriber role. >> Below function is used to add users as subscribers in their first login >> to subscriber tables in asset.js function in store extension. similar >> requirement needs for signup as well. how do I achieve this? >> >> [1] https://wso2.org/jira/browse/REGISTRY-2683 >> >> Thanks >> -- >> Lakshman Udayakantha >> WSO2 Inc. www.wso2.com >> lean.enterprise.middleware >> Mobile: *0711241005* >> >> > > > -- > Lakshman Udayakantha > WSO2 Inc. www.wso2.com > lean.enterprise.middleware > Mobile: *0711241005* > > -- Sameera Medagammaddegedara Software Engineer Contact: Email: samee...@wso2.com Mobile: + 94 077 255 3005
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev