| 
									
										
										
										
											2017-08-10 16:33:54 -06:00
										 |  |  | app.factory('Auth', ['localStorageService', '$location', function(localStorageService, $location) { | 
					
						
							| 
									
										
										
										
											2017-08-09 12:41:43 -06:00
										 |  |  |   var user; | 
					
						
							| 
									
										
										
										
											2017-08-10 16:33:54 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-09 12:41:43 -06:00
										 |  |  |   return{ | 
					
						
							| 
									
										
										
										
											2017-08-11 09:09:41 -06:00
										 |  |  |     setUser: function(currentUser){ | 
					
						
							| 
									
										
										
										
											2017-08-09 12:41:43 -06:00
										 |  |  |       user = currentUser; | 
					
						
							| 
									
										
										
										
											2017-08-10 16:33:54 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-11 09:09:41 -06:00
										 |  |  |       // console.log("%c" + redirectedURL, "color: red; font-size: 72px;");
 | 
					
						
							| 
									
										
										
										
											2017-08-10 16:33:54 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |       if (redirectedURL === '/splash-page') { | 
					
						
							|  |  |  |         $location.path('/launchpad-home'); | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         $location.path('/launchpad-' + redirectedURL); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2017-08-09 12:41:43 -06:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2017-08-11 09:09:41 -06:00
										 |  |  |     isLoggedIn: function(){ | 
					
						
							| 
									
										
										
										
											2017-08-09 12:41:43 -06:00
										 |  |  |       user = JSON.parse(localStorageService.get('userAuth')); | 
					
						
							|  |  |  |       return (user) ? user : false; | 
					
						
							| 
									
										
										
										
											2017-08-11 09:09:41 -06:00
										 |  |  |     }, | 
					
						
							|  |  |  |     getProfile: function(profile) { | 
					
						
							|  |  |  |       profile = user; | 
					
						
							|  |  |  |       return profile; | 
					
						
							| 
									
										
										
										
											2017-08-09 12:41:43 -06:00
										 |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2017-08-08 22:23:19 -06:00
										 |  |  | }]); |