I have in my app:
useEffect(() => {
async function doIt() {
const authClient = await AuthClient.create();
authClient.login({
// 7 days in nanoseconds
maxTimeToLive: BigInt(7 * 24 * 60 * 60 * 1000 * 1000 * 1000),
onSuccess: async () => {
console.log('ID');
},
onError(error) {
console.log('error', error);
},
});
}
doIt().then(()=>{});
}, []);
But it does not ask user to connect Internet Identity. Instead it outputs in the browser logs:
WARNING: expected origin 'https://identity.ic0.app', got 'http://127.0.0.1:8000' (ignoring)
What is my error?
Also, how to get the ID (I think, it is Principal; or maybe, it’s the small integer that identifies the user on NNS (but I think, the small number may be duplicate on different identity providers, so it probably doesn’t suit me)) of the currently logged in user?