In SharePoint 2013 (AD login), I could get from the domain\username from username() e.g.(a:1#.b|domain\username)
in O365 there is no domain anymore only email
the login looks like: .(a:1#.b|membership|fname.lname@abc.com)
Is there a way to find the domain, any workaround?