@hatkom/aws-auth 1.4.4 → 1.5.0
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/CHANGELOG.md +14 -0
- package/README.md +20 -1
- package/dist/auth.d.ts +42 -0
- package/dist/auth.js +168 -0
- package/dist/auth.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.5.0](https://github.com/Hatkom-io/aws-auth/compare/v1.4.5...v1.5.0) (2026-09-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* adopt external session, select token use ([3b70040](https://github.com/Hatkom-io/aws-auth/commit/3b700408cf5e3675b330073eb867524c458ccd1b))
|
|
7
|
+
|
|
8
|
+
## [1.4.5](https://github.com/Hatkom-io/aws-auth/compare/v1.4.4...v1.4.5) (2026-03-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* tsconfig compiled wrong build ([39e3ced](https://github.com/Hatkom-io/aws-auth/commit/39e3ced05748674598b2502c3703fc318332265b))
|
|
14
|
+
|
|
1
15
|
## [1.4.4](https://github.com/Hatkom-io/aws-auth/compare/v1.4.3...v1.4.4) (2026-03-24)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@ const session = await auth.authenticateUser({ email: 'user@example.com', passwor
|
|
|
20
20
|
|
|
21
21
|
// Get current session token (auto-refreshes if expired)
|
|
22
22
|
const token = await auth.getCurrentSessionToken()
|
|
23
|
+
const idToken = await auth.getCurrentSessionToken('id')
|
|
24
|
+
|
|
25
|
+
// Adopt a session obtained elsewhere (e.g. a server-mediated sign-in)
|
|
26
|
+
await auth.adoptSession({ username, idToken, accessToken, refreshToken })
|
|
23
27
|
|
|
24
28
|
// Sign out
|
|
25
29
|
await auth.signOut()
|
|
@@ -28,10 +32,25 @@ await auth.signOut()
|
|
|
28
32
|
## API
|
|
29
33
|
|
|
30
34
|
- `authenticateUser({ email, password })` — sign in, returns session or `'new-password-required'`
|
|
31
|
-
- `getCurrentSessionToken()` — returns current
|
|
35
|
+
- `getCurrentSessionToken(tokenUse?)` — returns the current JWT, refreshing if needed. `tokenUse` is `'access'` (default) or `'id'`
|
|
36
|
+
- `adoptSession({ username, idToken, accessToken, refreshToken })` — store a session obtained outside the browser, so the SDK handles renewal, revocation and storage from then on
|
|
32
37
|
- `signOut()` — signs out the current user
|
|
33
38
|
- `completeNewPasswordChallenge({ username, newPassword })` — complete a new password challenge
|
|
34
39
|
- `forgotPassword(username)` — initiate forgot password flow
|
|
35
40
|
- `forgotPasswordSubmit({ username, verificationCode, password })` — submit new password
|
|
36
41
|
- `resendVerificationCode(username)` — resend email verification code
|
|
37
42
|
- `verifyUserEmail({ username, code })` — confirm email registration
|
|
43
|
+
|
|
44
|
+
### `adoptSession`
|
|
45
|
+
|
|
46
|
+
Use it when sign-in happens on your server (`InitiateAuth` / `RespondToAuthChallenge`) and the
|
|
47
|
+
browser receives a finished `AuthenticationResult`. The tokens are cached under the same storage
|
|
48
|
+
keys a browser-side login writes, so `getCurrentSessionToken()`, refresh and `signOut()` all work
|
|
49
|
+
afterwards, including across a page reload.
|
|
50
|
+
|
|
51
|
+
`username` must be the **Cognito username**, not the e-mail. A pool configured with
|
|
52
|
+
`usernameAttributes: ['email']` generates a UUID internal username, and the cache keys are built
|
|
53
|
+
from it — passing the e-mail leaves nothing findable on the next page load.
|
|
54
|
+
|
|
55
|
+
If your API authorizes on e-mail, read the ID token (`getCurrentSessionToken('id')`): with a
|
|
56
|
+
UUID username the access token carries no `email` claim.
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CognitoUserSession } from 'amazon-cognito-identity-js';
|
|
2
|
+
type AuthenticateUserArgs = {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
};
|
|
6
|
+
type ForgotPasswordSubmitArgs = {
|
|
7
|
+
username: string;
|
|
8
|
+
verificationCode: string;
|
|
9
|
+
password: string;
|
|
10
|
+
};
|
|
11
|
+
type VerifyUserEmailArgs = {
|
|
12
|
+
username: string;
|
|
13
|
+
code: string;
|
|
14
|
+
};
|
|
15
|
+
type CompleteNewPasswordChallengeArgs = {
|
|
16
|
+
username: string;
|
|
17
|
+
newPassword: string;
|
|
18
|
+
};
|
|
19
|
+
type AdoptSessionArgs = {
|
|
20
|
+
username: string;
|
|
21
|
+
idToken: string;
|
|
22
|
+
accessToken: string;
|
|
23
|
+
refreshToken: string;
|
|
24
|
+
};
|
|
25
|
+
type TokenUse = 'access' | 'id';
|
|
26
|
+
declare class AWSAuthClient {
|
|
27
|
+
private userPool;
|
|
28
|
+
private syncStoragePromise;
|
|
29
|
+
constructor(UserPoolId: string, ClientId: string);
|
|
30
|
+
signOut: () => Promise<void>;
|
|
31
|
+
completeNewPasswordChallenge: ({ username, newPassword, }: CompleteNewPasswordChallengeArgs) => Promise<unknown>;
|
|
32
|
+
resendVerificationCode: (username: string) => Promise<unknown>;
|
|
33
|
+
verifyUserEmail: ({ username, code }: VerifyUserEmailArgs) => Promise<unknown>;
|
|
34
|
+
forgotPassword: (username: string) => Promise<unknown>;
|
|
35
|
+
forgotPasswordSubmit: ({ username, verificationCode, password, }: ForgotPasswordSubmitArgs) => Promise<unknown>;
|
|
36
|
+
authenticateUser: ({ email, password }: AuthenticateUserArgs) => Promise<CognitoUserSession | "new-password-required">;
|
|
37
|
+
adoptSession: ({ username, idToken, accessToken, refreshToken, }: AdoptSessionArgs) => Promise<void>;
|
|
38
|
+
getCurrentSessionToken: (tokenUse?: TokenUse) => Promise<string | null>;
|
|
39
|
+
private isValid;
|
|
40
|
+
private cognitoUser;
|
|
41
|
+
}
|
|
42
|
+
export { AWSAuthClient, CognitoUserSession };
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CognitoUserSession = exports.AWSAuthClient = void 0;
|
|
4
|
+
const amazon_cognito_identity_js_1 = require("amazon-cognito-identity-js");
|
|
5
|
+
Object.defineProperty(exports, "CognitoUserSession", { enumerable: true, get: function () { return amazon_cognito_identity_js_1.CognitoUserSession; } });
|
|
6
|
+
const needsToSyncStorage = (userPool) => !!('storage' in userPool &&
|
|
7
|
+
typeof userPool.storage === 'function' &&
|
|
8
|
+
'sync' in userPool.storage &&
|
|
9
|
+
typeof userPool.storage.sync === 'function');
|
|
10
|
+
const getToken = (session, tokenUse) => tokenUse === 'id' ? session.getIdToken() : session.getAccessToken();
|
|
11
|
+
class AWSAuthClient {
|
|
12
|
+
userPool;
|
|
13
|
+
syncStoragePromise;
|
|
14
|
+
constructor(UserPoolId, ClientId) {
|
|
15
|
+
this.userPool = new amazon_cognito_identity_js_1.CognitoUserPool({
|
|
16
|
+
UserPoolId,
|
|
17
|
+
ClientId,
|
|
18
|
+
});
|
|
19
|
+
this.syncStoragePromise = new Promise((resolve) => {
|
|
20
|
+
if (needsToSyncStorage(this.userPool)) {
|
|
21
|
+
this.userPool.storage.sync(resolve);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
resolve();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
signOut = async () => {
|
|
28
|
+
await this.syncStoragePromise;
|
|
29
|
+
const user = this.userPool.getCurrentUser();
|
|
30
|
+
if (!user) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
await new Promise((resolve) => {
|
|
35
|
+
user.signOut(resolve);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error('SignOut error', { extra: JSON.stringify(error) });
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
completeNewPasswordChallenge = ({ username, newPassword, }) => {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
this.cognitoUser(username).completeNewPasswordChallenge(newPassword, [], {
|
|
45
|
+
onSuccess: resolve,
|
|
46
|
+
onFailure: reject,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
resendVerificationCode = async (username) => {
|
|
51
|
+
await this.syncStoragePromise;
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
this.cognitoUser(username).resendConfirmationCode((err, result) => {
|
|
54
|
+
if (err) {
|
|
55
|
+
reject(err);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
resolve(result);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
verifyUserEmail = async ({ username, code }) => {
|
|
63
|
+
await this.syncStoragePromise;
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
this.cognitoUser(username).confirmRegistration(code, true, (error) => {
|
|
66
|
+
if (error) {
|
|
67
|
+
reject(error);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
resolve(true);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
forgotPassword = async (username) => {
|
|
75
|
+
await this.syncStoragePromise;
|
|
76
|
+
return new Promise((resolve, reject) => {
|
|
77
|
+
this.cognitoUser(username).forgotPassword({
|
|
78
|
+
onSuccess: resolve,
|
|
79
|
+
onFailure: reject,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
forgotPasswordSubmit = async ({ username, verificationCode, password, }) => {
|
|
84
|
+
await this.syncStoragePromise;
|
|
85
|
+
return new Promise((resolve, reject) => {
|
|
86
|
+
this.cognitoUser(username).confirmPassword(verificationCode, password, {
|
|
87
|
+
onSuccess: resolve,
|
|
88
|
+
onFailure: reject,
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
authenticateUser = async ({ email, password }) => {
|
|
93
|
+
await this.syncStoragePromise;
|
|
94
|
+
const authenticationDetails = new amazon_cognito_identity_js_1.AuthenticationDetails({
|
|
95
|
+
Username: email,
|
|
96
|
+
Password: password,
|
|
97
|
+
});
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
99
|
+
this.cognitoUser(email).authenticateUser(authenticationDetails, {
|
|
100
|
+
onSuccess: resolve,
|
|
101
|
+
onFailure: reject,
|
|
102
|
+
newPasswordRequired: () => {
|
|
103
|
+
resolve('new-password-required');
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
adoptSession = async ({ username, idToken, accessToken, refreshToken, }) => {
|
|
109
|
+
await this.syncStoragePromise;
|
|
110
|
+
this.cognitoUser(username).setSignInUserSession(new amazon_cognito_identity_js_1.CognitoUserSession({
|
|
111
|
+
IdToken: new amazon_cognito_identity_js_1.CognitoIdToken({ IdToken: idToken }),
|
|
112
|
+
AccessToken: new amazon_cognito_identity_js_1.CognitoAccessToken({ AccessToken: accessToken }),
|
|
113
|
+
RefreshToken: new amazon_cognito_identity_js_1.CognitoRefreshToken({ RefreshToken: refreshToken }),
|
|
114
|
+
}));
|
|
115
|
+
};
|
|
116
|
+
getCurrentSessionToken = async (tokenUse = 'access') => {
|
|
117
|
+
await this.syncStoragePromise;
|
|
118
|
+
const currentUser = this.userPool.getCurrentUser();
|
|
119
|
+
if (!currentUser) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
const session = await new Promise((resolve, reject) => {
|
|
123
|
+
currentUser.getSession((err, s) => {
|
|
124
|
+
if (err || !s) {
|
|
125
|
+
reject(err);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
resolve(s);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
const currentToken = getToken(session, tokenUse);
|
|
133
|
+
const valid = this.isValid(currentToken.getExpiration());
|
|
134
|
+
if (valid) {
|
|
135
|
+
return currentToken.getJwtToken();
|
|
136
|
+
}
|
|
137
|
+
const updatedSession = await new Promise((resolve, reject) => {
|
|
138
|
+
currentUser.refreshSession(session.getRefreshToken(), (error, value) => {
|
|
139
|
+
if (error) {
|
|
140
|
+
reject(error);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
resolve(value);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
return getToken(updatedSession, tokenUse).getJwtToken();
|
|
148
|
+
};
|
|
149
|
+
isValid = (tokenExpiration) => {
|
|
150
|
+
const now = Math.floor(new Date().getTime() / 1000);
|
|
151
|
+
const adjusted = now + 15;
|
|
152
|
+
return adjusted < tokenExpiration;
|
|
153
|
+
};
|
|
154
|
+
cognitoUser = (() => {
|
|
155
|
+
let user;
|
|
156
|
+
return (username) => {
|
|
157
|
+
if (!user || user.getUsername() !== username) {
|
|
158
|
+
user = new amazon_cognito_identity_js_1.CognitoUser({
|
|
159
|
+
Username: username,
|
|
160
|
+
Pool: this.userPool,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return user;
|
|
164
|
+
};
|
|
165
|
+
})();
|
|
166
|
+
}
|
|
167
|
+
exports.AWSAuthClient = AWSAuthClient;
|
|
168
|
+
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;AAAA,2EAQmC;AA0QX,mGA3QtB,+CAAkB,OA2QsB;AAtO1C,MAAM,kBAAkB,GAAG,CACzB,QAAyB,EACgB,EAAE,CAC3C,CAAC,CAAC,CACA,SAAS,IAAI,QAAQ;IACrB,OAAO,QAAQ,CAAC,OAAO,KAAK,UAAU;IACtC,MAAM,IAAI,QAAQ,CAAC,OAAO;IAC1B,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,CAC5C,CAAA;AAEH,MAAM,QAAQ,GAAG,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|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AWSAuthClient, CognitoUserSession } from './auth';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CognitoUserSession = exports.AWSAuthClient = void 0;
|
|
4
|
+
var auth_1 = require("./auth");
|
|
5
|
+
Object.defineProperty(exports, "AWSAuthClient", { enumerable: true, get: function () { return auth_1.AWSAuthClient; } });
|
|
6
|
+
Object.defineProperty(exports, "CognitoUserSession", { enumerable: true, get: function () { return auth_1.CognitoUserSession; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA0D;AAAjD,qGAAA,aAAa,OAAA;AAAE,0GAAA,kBAAkB,OAAA"}
|