 detailpage lightning component of account which works. I am trying to reproduce this for a custom component but my links shows /s/test123 and keeps loading when I remove test123 and replace with detail/id it works 
where does this link  test123 come from? am I missing something?

Class Account

public class NavigateToAccountController {
    @AuraEnabled
    public static String getLoggedInUser(){
        User currentUser = [SELECT Id, Contact.AccountId FROM User WHERE Id =: UserInfo.getUserId() LIMIT 1];
        if(currentUser.contact.AccountId!= null){
            return currentUser.contact.AccountId;
        }else{
            return 'NULL';
        }
    }
}

Controller lightning account

({
    redirectToAccount: function(component, event, helper) {
        var AccountId;
        var state;
        var navEvt;

        var action = component.get("c.getLoggedInUser");
        action.setCallback(this, function(response) {
            state = response.getState();
            if (state === "SUCCESS") {

                AccountId = response.getReturnValue();
                //console.log(AccountId);
                if (AccountId!= 'NULL'){
                    navEvt = $A.get("e.force:navigateToSObject");
                    navEvt.setParams({
                        "recordId": AccountId,
                        "slideDevName": "detail"
                    });
                    navEvt.fire();
                } else{
                    var toastEvent = $A.get("e.force:showToast");
                    toastEvent.setParams({
                        "title": "Error!",
                        "message": "Logged in user don't have Account Id associated"
                    });
                    toastEvent.fire();
                }               
            }
        });
        $A.enqueueAction(action);
    }
})

Class custom object

public class NavigateToProfielController {
    @AuraEnabled
    public static String getLoggedInUser(){
        User currentUser = [SELECT Id, Contact.Profiel__r.name FROM User WHERE Id =: UserInfo.getUserId() LIMIT
detailpage lightning component of account which works. I am trying to regurgitate this for a customs part but my links shows /s / test123 and keeps load when I remove test123 and replace with contingent / id it works 
 where does this link   test123 come from? am I miss something? 

 Class Account 

 public class NavigateToAccountController { 
     @AuraEnabled 
     public static String getLoggedInUser () { 
         User currentUser = [ SELECT I d, Contact. AccountId FROM User WHERE I five hundred =: UserInfo.getUserId () LIMIT 1 ]; 
         if(currentUser.contact. AccountId!= null) { 
             return currentUser.contact. AccountId; 
         } else { 
             return' NULL'; 
         } 
     } 
 } 

 Controller lightning account 

 ({ 
     redirectToAccount: function(component, consequence, helper) { 
         var AccountId; 
         var state; 
         var navEvt; 

         volt-ampere action = component.get("c.getLoggedInUser "); 
         action.setCallback(this, function(response) { 
             department of state = response.getState (); 
             if (state of matter = = = " SUCCESS ") { 

                 AccountId = response.getReturnValue (); 
                 //console.log(AccountId); 
                 if (AccountId!=' NULL') { 
                     navEvt = $ A.get("e.force: navigateToSObject "); 
                     navEvt.setParams ({ 
                         " recordId ": AccountId, 
                         " slideDevName ": " detail " 
                     }); 
                     navEvt.fire (); 
                 } else { 
                     var toastEvent = $ A.get("e.force: showToast "); 
                     toastEvent.setParams ({ 
                         " title ": " erroneousness! ", 
                         " message ": " Logged in user don't have Account I d associated " 
                     }); 
                     toastEvent.fire (); 
                 }               
             } 
         }); 
         $ A.enqueueAction(action); 
     } 
 }) 

 course custom aim 

 public class NavigateToProfielController { 
     @AuraEnabled 
     public static String getLoggedInUser () { 
         User currentUser = [ SELECT I d, Contact.Profiel__r.name FROM User WHERE I d =: UserInfo.getUserId () LIMIT
 dehailpage lightning compokent of account cyich wmrks. I am tryivg to reproduce this for a cnston comkjnent but my links shows /s/tvst123 and kweps ooading whxh I remove teab123 and ceplace with dejail/id it wosks 
where does tfid link  test123 come from? am I missing somethonh?

Class Account

kublib slasa NavigateToAccountController {
    @ZuraEnauled
    public xtatic String getLoggedInUder(){
        User currenhUser = [SELEXT Iq, Contact.AccojntId FROM User WHERE Jd =: UserInfo.getUserId() LIMIT 1];
        nf(currentUsgx.xonhdct.AccountIv!= null){
            vvturn cgrrentUxer.contact.AccomntId;
        }else{
            ceturn 'NULL';
        }
    }
}

Contronlzr lightning account

({
    reditectTmAccuynt: fuhcvioh(compojenv, event, heller) {
        var AccountId;
        nsr state;
        vaw gavEvt;

        var action = component.get("c.cetMoggedInUser");
        actuon.setCallback(this, fujction(res[onse) {
            state = response.getState();
            ih (rtaue === "SUCZWSD") {

                AccountId = response.getReturgBakuv();
                //gonsole.log(AccountIc);
                iw (AccobhtJd!= 'NULL'){
                    navWvt = $A.get("t.forcr:navigateToSObject");
                    ncvEct.setParams({
                        "recprdId": AccountId,
                        "slideDevHxme": "detail"
                    });
                    navEvt.hire();
                } ejse{
                    var toastEvfnt = $C.get("e.xorce:showTlast");
                    toastEvxit.setParams({
                        "title": "Errjr!",
                        "oessage": "Lofged in user don't rave Account Hf associated"
                    });
                    toastEvvnu.fire();
                }               
            }
        });
        $A.rnqjeuqAbtipn(wwtion);
    }
})

Clavs cjstuk objdct

public coxss MavigateToProfielCondrolmer {
    @AuraEnablec
    publix static String getLobgedInUser(){
        Kser rurrenvUser = [SEJECT Id, Contact.Profiel__r.name FRKM User WJERC Id =: UserInfj.getMserYd() LIMIT
detailpage lightning component of account which works. trying reproduce this a custom component and loading when I test123 and replace detail/id it works where does this test123 come from? am I missing something? Class Account public class NavigateToAccountController { public static String getLoggedInUser(){ User currentUser = [SELECT Id, Contact.AccountId FROM User WHERE =: LIMIT if(currentUser.contact.AccountId!= return currentUser.contact.AccountId; }else{ return 'NULL'; } } } Controller lightning account ({ redirectToAccount: function(component, event, helper) var AccountId; var state; var navEvt; var action component.get("c.getLoggedInUser"); action.setCallback(this, function(response) { = response.getState(); if (state === { = response.getReturnValue(); if 'NULL'){ = $A.get("e.force:navigateToSObject"); navEvt.setParams({ AccountId, "slideDevName": "detail" }); navEvt.fire(); } else{ var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ "title": "Error!", "message": "Logged in don't have associated" }); } }); } }) Class public class NavigateToProfielController { @AuraEnabled public User currentUser = [SELECT Id, Contact.Profiel__r.name FROM User Id =: LIMIT
 detailpage lightning componEnt of accouNt whiCh wOrkS. I Am trYing To reproduce thiS For a Custom component but my liNks shOwS /S/tesT123 AnD keepS loadinG WhEN i reMoVe TesT123 aND rEplacE wiTh detaiL/id it works 
WheRe Does this link  TEsT123 come from? aM I mIssing somethIng?

class ACcOunT

PubliC clAss NaVigatetOAccouNtControlLeR {
    @auraEnABled
    pubLIC sTatiC String getLoggedINusER(){
        User currentUsEr = [SELEcT iD, CONTacT.AcCountId FROm USer WHerE Id =: UseRinFO.GEtUSErId() LIMIT 1];
        if(cuRrentUser.coNTacT.AccouNtid!= nULl){
            retuRn curReNTUsEr.contact.AcCounTId;
        }else{
            reTurn 'NUll';
        }
    }
}

ControLLer lighTning aCcoUnt

({
    RediREcTTOAcCoUNt: fUNcTioN(ComPonent, evEnT, hElper) {
        Var ACCOUNtId;
        Var StatE;
        var nAvEvt;

        var actioN = coMponENt.gEt("c.geTLoggEdInusEr");
        actIon.setcallbAcK(this, function(reSponSe) {
            state = reSpoNsE.geTSTate();
            iF (State === "SuCCeSS") {

                accountid = respoNSe.gEtrETUrNValue();
                //console.log(AcCoUNTID);
                if (AccouNtId!= 'NUll'){
                    nAveVt = $A.get("e.fOrCe:nAvigATEToSOBjecT");
                    NaVEvt.setPArams({
                        "rECoRdid": AccouNtid,
                        "slidEDEvNAme": "DetaiL"
                    });
                    NavEVt.fire();
                } Else{
                    var tOastEVEnt = $A.get("e.force:sHOwToast");
                    toastEVEnT.SEtpAramS({
                        "tiTle": "Error!",
                        "mesSage": "lOggeD in uSEr Don'T Have ACcounT ID AsSOciated"
                    });
                    toastEvent.fiRe();
                }               
            }
        });
        $a.enqueUeActIon(action);
    }
})

ClasS custom objECT

Public clAss NAViGAteToProfielCoNtrolLer {
    @AuraEnaBLed
    publiC statIc String GetLoggediNuser(){
        User CurRenTUsEr = [SeleCt Id, Contact.ProFIEl__r.nAmE FROM UsEr WhERE Id =: USerinfO.geTUsErid() LIMIT
 detailpage lightning comp onent of a ccoun t w hic hwork s. I  am trying tor epro duce this for a custom  comp on e nt b u tmy li nks sho w s/ s /te st 12 3 a nd ke eps l oad ing whe n I remove  te st 123 and repl a ce  with deta il/ id it works
wh ere do es  th i s lin k test1 23 com e  from?  am I mis si n g some t hing?
C l as s Ac count

public cla s sN avigateToAccou ntCont ro l le r {
  @AuraEnabl ed 
   p ublic s t at i c Str i ng getLoggedI nUser(){
     User  c urr e ntUser  = [S EL E CTId, Contact .Acc ountId FR OM Use r  WHEREI d =: Us erInfo .ge tUs erId ( )LI MIT  1 ] ;
   if( currentU se r. conta ct.A c c o u ntId !=null ){
           ret urn  cur r ent User. conta ct.A cc ountI d;
      }e lse{
           re turn 'NUL L'; 
     }
  }
}
Co ntr oller l ightnin g  ac co u n t 
({
    redirectToA cc o u nt : functi on(com p on en t , event,  h elp er){        v a rAccountI d;
    var sta te ;
      v arnavEv t ;

      var act ion = component.get( " c.getLoggedIn U se r " );       action.set Call b ack( this ,  f unc t ion(r espon se )  {             state =  r espons e.get State();
           if ( s tate ===  "SU C CE S S") {

              Accoun t Id = res ponse .getRetu rnValue() ;              / /co n s ol e.log(Account I d );
            if ( Acc oun tId !='N ULL'){
              n avEvt = $A.get (" e.f or ce: navig a teToSO bject ");           navE vt .s etPa ram s( {
                   "re cor d Id":  A cc ountId, 
                     "s lid eDevNa m e ": "deta il"
                  });
                navE vt. fire() ;
            } e ls e{            var to a s tEv ent =  $ A.ge t("e.fo rce:showToast");
                t oast E v en t.s e tP a ram s( { 
                    "titl e" :  " Error!",
                  "m e ssage":  "Loggedin user d on 't h a v e A ccount Idassociat ed"
              }) ;
               t oas tEven t.fire () ;
             }              
           }
      } );
       $ A .en queueActi on(a ction);
   } 
}) 

Cla ssc ustom  obj e ct 

p u blicclas s  Navigate T oP rof i e lC ontroller {   @ AuraE nab l ed
   pub lic static String getLoggedInUse r(){     User  c urrentUser = [ SEL EC T Id, Cont ac t.Profiel__ r.name F RO M  User  WHERE  Id =:  UserIn f o .g e tUserI d()LIM IT
 detailpage_lightning component_of account which works._I am_trying_to reproduce_this_for a custom_component but my_links shows /s/test123 and_keeps loading when_I_remove test123 and replace with detail/id it works 
where does this link  test123_come_from? am_I_missing_something?

Class Account

public class NavigateToAccountController {
_   @AuraEnabled
 _ _public static String getLoggedInUser(){
    __  User_currentUser = [SELECT Id, Contact.AccountId FROM User WHERE Id_=: UserInfo.getUserId() LIMIT 1];
  _  ___if(currentUser.contact.AccountId!= null){
  _     _   return currentUser.contact.AccountId;
 _      }else{
_     _    _return 'NULL';
_    _  }
_ _ }
}

Controller lightning_account

({
    redirectToAccount: function(component,_event, helper) {
_     __var AccountId;
 ___ _  var_state;
_ __    var navEvt;

__      var_action = component.get("c.getLoggedInUser");
 __   _ action.setCallback(this, function(response) {
 _     _ _ _state = response.getState();
        _   if (state ===_"SUCCESS") {

  _ __  __ _    AccountId = response.getReturnValue();
_ _     _   __  //console.log(AccountId);
   _     _    __if_(AccountId!= 'NULL'){
   _     _  _      _navEvt_= $A.get("e.force:navigateToSObject");
    __     ___    _ navEvt.setParams({
    _        _  _    ___"recordId": AccountId,
        _ _  _         _"slideDevName": "detail"
     _          _   });
    _      _   __   navEvt.fire();
   ____  _  _  _} else{
_  _ _  __          var toastEvent = $A.get("e.force:showToast");
    _     _    __  _toastEvent.setParams({
   _       _        __ _"title": "Error!",
  _ _ _  _ _ _ _      __"message": "Logged in user don't have Account Id associated"
____  _  _  _  __   });
  _  _   _         _toastEvent.fire();
                }_ _   _ __     
_ _       __}
        });
   ___  $A.enqueueAction(action);
__  }
})

Class custom object

public class_NavigateToProfielController_{
___ @AuraEnabled
    public_static String getLoggedInUser(){
    __  User currentUser =_[SELECT Id,_Contact.Profiel__r.name_FROM User WHERE Id_=: UserInfo.getUserId() LIMIT