1.2.0 • Published 1 year ago
minecraft-login v1.2.0
const {
authenticate
} = require('minecraft-login');
(async () => {
try {
const auth = await authenticate();
console.log(`Visit ${auth.verificationUrl} and enter the code ${auth.userCode}`);
// Wait for the user to complete the authentication and finish the flow
const data = await auth.onComplete();
console.log('Authentication successful:', data);
} catch (error) {
console.error('Authentication failed:', error.message);
}
})();