@remit/web-client 0.0.297 → 0.0.298
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.298",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
|
|
6
6
|
"exports": {
|
|
@@ -138,8 +138,8 @@ function joinDomains(domains: readonly string[]): string {
|
|
|
138
138
|
/**
|
|
139
139
|
* The clauses naming what does not line up on a message whose signature checks
|
|
140
140
|
* out. Empty when everything the backend compared agreed — including when it
|
|
141
|
-
* compared nothing, which is every message the provider's
|
|
142
|
-
* already call spam.
|
|
141
|
+
* compared nothing, which is every message outside Junk that the provider's
|
|
142
|
+
* filter did not already call spam.
|
|
143
143
|
*
|
|
144
144
|
* Each clause leads with the concern and names `auth.fromDomain` — the
|
|
145
145
|
* domain `classifyDisplayNameCorrespondence` actually compared the display
|
|
@@ -34,6 +34,13 @@ describe("mapOauthError", () => {
|
|
|
34
34
|
);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
test("scope_not_granted sends the person back through the consent", () => {
|
|
38
|
+
assert.match(
|
|
39
|
+
mapOauthError("scope_not_granted"),
|
|
40
|
+
/did not grant access to every service you picked/,
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
|
|
37
44
|
test("consent_required returns admin consent message", () => {
|
|
38
45
|
const result = mapOauthError("consent_required");
|
|
39
46
|
assert.ok(
|
|
@@ -99,6 +106,7 @@ const REAUTH_ACCOUNT = {
|
|
|
99
106
|
displayName: "Matthijs",
|
|
100
107
|
authType: "oauthMicrosoft",
|
|
101
108
|
connectionState: "reauth_required",
|
|
109
|
+
syncedServices: ["Mail", "Calendar"],
|
|
102
110
|
};
|
|
103
111
|
|
|
104
112
|
// The router reads `self` at construction; the shared jsdom globals stop at
|
|
@@ -195,6 +203,16 @@ describe("the Reconnect button and the redirect it starts", () => {
|
|
|
195
203
|
Reflect.deleteProperty(document, "visibilityState");
|
|
196
204
|
});
|
|
197
205
|
|
|
206
|
+
test("asks Microsoft again for every service the account syncs", async () => {
|
|
207
|
+
const dom = await mountAccounts();
|
|
208
|
+
await startReconnect(dom);
|
|
209
|
+
|
|
210
|
+
assert.deepEqual(http?.to("/oauth/microsoft/start")[0]?.body, {
|
|
211
|
+
email: REAUTH_ACCOUNT.email,
|
|
212
|
+
services: ["Mail", "Calendar"],
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
198
216
|
test("goes busy and stays busy while the redirect is in flight", async () => {
|
|
199
217
|
const dom = await mountAccounts();
|
|
200
218
|
await startReconnect(dom);
|
|
@@ -64,6 +64,10 @@ export function mapOauthError(code: string): string {
|
|
|
64
64
|
return "You cancelled the sign-in.";
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
if (lower === "scope_not_granted") {
|
|
68
|
+
return "Microsoft did not grant access to every service you picked. Sign in again and accept each permission Microsoft asks for.";
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
if (
|
|
68
72
|
lower === "consent_required" ||
|
|
69
73
|
lower.includes("admin_consent") ||
|
|
@@ -440,7 +444,10 @@ function AccountsSettings() {
|
|
|
440
444
|
onClick: () => {
|
|
441
445
|
setReconnectingAccountId(account.accountId);
|
|
442
446
|
reconnectMutation.mutate({
|
|
443
|
-
body: {
|
|
447
|
+
body: {
|
|
448
|
+
email: account.email,
|
|
449
|
+
services: account.syncedServices,
|
|
450
|
+
},
|
|
444
451
|
});
|
|
445
452
|
},
|
|
446
453
|
}
|