public LoginResponse?LoginWindowsAuthentication() { using (ScopeSessionFactory.OverrideSession()) { if (!WindowsAuthenticationServer.LoginWindowsAuthentication(ControllerContext)) { return(null); } var token = AuthTokenServer.CreateToken(UserEntity.Current); return(new LoginResponse { message = null, userEntity = UserEntity.Current, token = token }); } }
public LoginResponse?LoginWindowsAuthentication(bool throwError) { string?error = WindowsAuthenticationServer.LoginWindowsAuthentication(ControllerContext); if (error != null) { if (throwError) { throw new InvalidOperationException(error); } return(null); } var token = AuthTokenServer.CreateToken(UserEntity.Current); return(new LoginResponse { userEntity = UserEntity.Current, token = token, authenticationType = "windows" }); }
public LoginResponse?LoginWindowsAuthentication(bool throwError) { using (ScopeSessionFactory.OverrideSession()) { string?error = WindowsAuthenticationServer.LoginWindowsAuthentication(ControllerContext); if (error != null) { if (throwError) { throw new InvalidOperationException(error); } return(null); } var token = AuthTokenServer.CreateToken(UserEntity.Current); return(new LoginResponse { message = null, userEntity = UserEntity.Current, token = token }); } }