@msout/microsoft-webauth 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 enola/phptr/msout
3
+ Copyright (c) 2026 enoola/phptr/msout
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,18 +1,24 @@
1
1
  # microsoft-webauth
2
2
 
3
3
  A tool to authenticate against microsoft online (live or professionnal tenants)
4
+ We do not rely on GraphAPI.
4
5
  e.g:
5
6
  - https://onenote.cloud.microsoft/notebooks
6
7
  - https://outlook.live.com/mail/
7
8
  - and by extension https://login.microsoft.com
8
9
 
9
- Microsoft web authentication via Playwright — extracted from [MSOneNote Exporter](https://github.com/msout/Microsoft-OneNote-Exporter).
10
+ Microsoft web authentication via Playwright — extracted from [MSOneNote Exporter](https://github.com/enoola/Microsoft-OneNote-Exporter).
11
+ I did extract it realising it might be useful out of the box for other projects.
12
+ And it will make it easier to maintain as far as I see it.
10
13
 
11
14
  This is a standalone CLI tool for authenticating with Microsoft accounts using Playwright. It handles:
15
+ - NO GraphAPI
12
16
  - Automated login with email/password
13
17
  - Manual login in browser
14
18
  - MFA/2FA support (OTC codes, number matching)
15
19
  - Session persistence
20
+
21
+
16
22
  ## Available on npmjs
17
23
 
18
24
  You can find this package here: https://www.npmjs.com/package/@msout/microsoft-webauth
package/jest.config.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @fileoverview Jest configuration.
3
+ * @author phptr,enoola,msout
4
+ * @copyright 2026 phptr,enoola,msout
5
+ */
1
6
  module.exports = {
2
7
  testEnvironment: 'node',
3
8
  testPathIgnorePatterns: ['/node_modules/', '/dist/'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msout/microsoft-webauth",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Microsoft web authentication module, using playwright to automate the login process and retrieve cookies for authenticated sessions.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -22,7 +22,7 @@
22
22
  "javascript"
23
23
  ],
24
24
  "author": "msout@tuta.io",
25
- "license": "MIT",
25
+ "license": "Apache-2.0",
26
26
  "repository": {
27
27
  "type": "git",
28
28
  "url": "git+https://github.com/Ms-OneNote-Exporter/microsoft-webauth.git"
package/src/auth.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @fileoverview This file handles user authentication logic.
3
+ * @author phptr,enoola,msout
4
+ * @copyright 2026 phptr,enoola,msout
5
+ */
1
6
  const { chromium } = require('playwright');
2
7
  const fs = require('fs-extra');
3
8
  const logger = require('./utils/logger');
@@ -486,7 +491,7 @@ async function login(credentials = {}) {
486
491
  } catch (e) {
487
492
  logger.debug(`Post-password verification handling skipped or failed: ${e.message}`);
488
493
  }
489
-
494
+
490
495
  // 2.7. Handle "Help protect your account" interrupt screen
491
496
  try {
492
497
  const interruptPrompt = page.getByText(/Help protect your account/i).first();
package/src/config.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @fileoverview Returns the directory where auth files (auth.json, auth-meta.json) are stored.
3
+ * @author phptr,enoola,msout
4
+ * @copyright 2026 phptr,enoola,msout
5
+ */
1
6
  const path = require('path');
2
7
 
3
8
  /**
package/src/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview Main CLI interface to handle authentication commands.
4
+ * @author phptr,enoola,msout
5
+ * @copyright 2026 phptr,enoola,msout
6
+ */
2
7
  const { program } = require('commander');
3
8
  const logger = require('./utils/logger');
4
9
  const { login, checkAuth, getAuthMeta, logout } = require('./auth');