Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- User u = new User();
- Contact c= new Contact(AccountId = DEF_ACC_ID,....);
- insert c;
- u.ContactId = c.Id;
- insert u;
- <apex:page controller="MobileAppLoginCtrl" action="{!onInit}">
- </apex:page>
- public class MobileAppLoginCtrl {
- public PageReference onInit() {
- String un = ApexPages.currentPage().getParameters().get('un');
- String pass = ApexPages.currentPage().getParameters().get('pw');
- PageReference pr = Site.login(un, pass, '/one/one.app');
- pr.setRedirect(true);
- System.debug (pr);
- return pr;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement