Question: Sorry no code here because I am looking for a better idea or if I am on the right track?

I have two websites, lets call them A and B.

A is a website exposed to the internet and only users with valid account can access.

B is a internal (intranet) website with (Windows authentication using Active directory). I want Application B (intranet) to create users for Application A.

Application A is using the inbuilt ASP.NET JWT token authentication.

My idea is to expose a Api on the extranet website (A) and let (B) access this API. I can use CORS to make sure only (B) has access to the end point but I am not sure if this is a good enough protection? We will perform security penetrations test from a third party company so this might fail the security test?

Or

I can use entity framework to a update the AspnetUsers table manually. Not idea if this is feasible or the right way or doing things.

Any other solution?

Answer: 
You can use the onclick event of the button. Add JQuery and use the below code.

```
var cnt = 0;
$('#btn').on('click', function() {
  cnt++;
  if(cnt == 2)
    $('#lbl').hide();
})

```

OR, in vanilla js you can use

```
var cnt = 0;
document.getElementById('btn').onclick = function() {
  cnt++;
  if(cnt == 2)
    document.getElementById('lbl').style.display = 'none';
};

```
Keep a count of the number of times the button has been clicked and when it reaches 2 make the lbl display none.

This snippet adds an event listener to the label to achieve this.

```js
let count = 0;
const btn = document.querySelector('#btn');
const lbl = document.querySelector('#lbl');
btn.addEventListener('click', function() {
  count++;
  if (count == 2) {
    lbl.style.display = 'none';
  }
});
```

```html
<button id="btn">Button</button>
<label id="lbl">lbl</label>
```