@oxy.so/services 12.3.0 → 12.4.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/README.md +1 -1
- package/lib/commonjs/index.js +17 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyAuthenticatorPanel.js +11 -10
- package/lib/commonjs/ui/components/signIn/OxyAuthenticatorPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js +19 -18
- package/lib/commonjs/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyEmailPanel.js +251 -0
- package/lib/commonjs/ui/components/signIn/OxyEmailPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +40 -33
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js +51 -19
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxySignInSecurityPanel.js +154 -0
- package/lib/commonjs/ui/components/signIn/OxySignInSecurityPanel.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/ReauthStep.js +6 -4
- package/lib/commonjs/ui/components/signIn/ReauthStep.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/SessionsSection.js +200 -0
- package/lib/commonjs/ui/components/signIn/SessionsSection.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js +6 -0
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/accountSecurityState.js +74 -0
- package/lib/commonjs/ui/components/signIn/accountSecurityState.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +1 -1
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/screenComponents.js +4 -0
- package/lib/commonjs/ui/navigation/screenComponents.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSecurityPanelScreen.js +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +8 -196
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInEmailScreen.js +19 -0
- package/lib/commonjs/ui/screens/SignInEmailScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInSecurityScreen.js +30 -0
- package/lib/commonjs/ui/screens/SignInSecurityScreen.js.map +1 -0
- package/lib/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyAuthenticatorPanel.js +12 -11
- package/lib/module/ui/components/signIn/OxyAuthenticatorPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js +20 -19
- package/lib/module/ui/components/signIn/OxyDeleteAccountPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyEmailPanel.js +246 -0
- package/lib/module/ui/components/signIn/OxyEmailPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +40 -33
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js +52 -20
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxySignInSecurityPanel.js +149 -0
- package/lib/module/ui/components/signIn/OxySignInSecurityPanel.js.map +1 -0
- package/lib/module/ui/components/signIn/ReauthStep.js +6 -4
- package/lib/module/ui/components/signIn/ReauthStep.js.map +1 -1
- package/lib/module/ui/components/signIn/SessionsSection.js +194 -0
- package/lib/module/ui/components/signIn/SessionsSection.js.map +1 -0
- package/lib/module/ui/components/signIn/accountFlowParts.js +6 -0
- package/lib/module/ui/components/signIn/accountFlowParts.js.map +1 -1
- package/lib/module/ui/components/signIn/accountSecurityState.js +69 -0
- package/lib/module/ui/components/signIn/accountSecurityState.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +1 -1
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/screenComponents.js +4 -0
- package/lib/module/ui/navigation/screenComponents.js.map +1 -1
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/screens/AccountSecurityPanelScreen.js +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +9 -197
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInEmailScreen.js +17 -0
- package/lib/module/ui/screens/SignInEmailScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInSecurityScreen.js +26 -0
- package/lib/module/ui/screens/SignInSecurityScreen.js.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthenticatorPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyEmailPanel.d.ts +21 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyEmailPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyPasswordPanel.d.ts +5 -4
- package/lib/typescript/commonjs/ui/components/signIn/OxyPasswordPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInSecurityPanel.d.ts +25 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInSecurityPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts +8 -2
- package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/SessionsSection.d.ts +9 -0
- package/lib/typescript/commonjs/ui/components/signIn/SessionsSection.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/accountSecurityState.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/signIn/accountSecurityState.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/screenComponents.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +2 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSecurityPanelScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +3 -2
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SignInEmailScreen.d.ts +6 -0
- package/lib/typescript/commonjs/ui/screens/SignInEmailScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/SignInSecurityScreen.d.ts +6 -0
- package/lib/typescript/commonjs/ui/screens/SignInSecurityScreen.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +4 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyAuthenticatorPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts +3 -2
- package/lib/typescript/module/ui/components/signIn/OxyDeleteAccountPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyEmailPanel.d.ts +21 -0
- package/lib/typescript/module/ui/components/signIn/OxyEmailPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts +2 -1
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyPasswordPanel.d.ts +5 -4
- package/lib/typescript/module/ui/components/signIn/OxyPasswordPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxySignInSecurityPanel.d.ts +25 -0
- package/lib/typescript/module/ui/components/signIn/OxySignInSecurityPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts +8 -2
- package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/SessionsSection.d.ts +9 -0
- package/lib/typescript/module/ui/components/signIn/SessionsSection.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/accountSecurityState.d.ts +26 -0
- package/lib/typescript/module/ui/components/signIn/accountSecurityState.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/screenComponents.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +2 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSecurityPanelScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +3 -2
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SignInEmailScreen.d.ts +6 -0
- package/lib/typescript/module/ui/screens/SignInEmailScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/SignInSecurityScreen.d.ts +6 -0
- package/lib/typescript/module/ui/screens/SignInSecurityScreen.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/index.ts +7 -2
- package/src/ui/components/signIn/OxyAuthenticatorPanel.tsx +11 -8
- package/src/ui/components/signIn/OxyDeleteAccountPanel.tsx +15 -16
- package/src/ui/components/signIn/OxyEmailPanel.tsx +258 -0
- package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +27 -15
- package/src/ui/components/signIn/OxyPasswordPanel.tsx +49 -14
- package/src/ui/components/signIn/OxySignInSecurityPanel.tsx +147 -0
- package/src/ui/components/signIn/ReauthStep.tsx +13 -4
- package/src/ui/components/signIn/SessionsSection.tsx +218 -0
- package/src/ui/components/signIn/accountFlowParts.tsx +6 -0
- package/src/ui/components/signIn/accountSecurityState.tsx +75 -0
- package/src/ui/navigation/routes.ts +5 -1
- package/src/ui/navigation/screenComponents.ts +4 -0
- package/src/ui/navigation/surfaceRegistry.ts +2 -0
- package/src/ui/screens/AccountSecurityPanelScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +8 -241
- package/src/ui/screens/SignInEmailScreen.tsx +13 -0
- package/src/ui/screens/SignInSecurityScreen.tsx +19 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Setting or
|
|
5
|
-
* is optional: the account signs in with a code by email without
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Setting, changing or removing the account's password, from its settings. A
|
|
5
|
+
* password is optional: the account signs in with a code by email without
|
|
6
|
+
* one, and it can be removed while the account has an email. Each change is
|
|
7
|
+
* confirmed with the current password (when there is one) or a code sent to
|
|
8
|
+
* the account's email, plus the authenticator's code when it has one.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
import { useState } from 'react';
|
|
@@ -15,12 +16,13 @@ import { toast } from '@oxy.so/bloom/toast';
|
|
|
15
16
|
import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH } from '@oxy.so/contracts/client';
|
|
16
17
|
import { useQueryClient } from '@tanstack/react-query';
|
|
17
18
|
import { useOxy } from "../../context/oxyRuntimeContext.js";
|
|
18
|
-
import { useSignInMethods } from "../../hooks/queries/useAuthMethods.js";
|
|
19
19
|
import { queryKeys } from "../../hooks/queries/queryKeys.js";
|
|
20
20
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
21
|
-
import {
|
|
21
|
+
import { SubtleLink } from "../authChooser/primitives.js";
|
|
22
|
+
import { OxyAuthScreen, OxyAuthScreenHeader } from "./OxyAuthScreen.js";
|
|
22
23
|
import { ReauthStep } from "./ReauthStep.js";
|
|
23
24
|
import { AccountFlowField } from "./accountFlowParts.js";
|
|
25
|
+
import { accountSecurityFallback, useAccountSecurityState } from "./accountSecurityState.js";
|
|
24
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
27
|
export const OxyPasswordPanel = ({
|
|
26
28
|
onDone,
|
|
@@ -30,18 +32,15 @@ export const OxyPasswordPanel = ({
|
|
|
30
32
|
t
|
|
31
33
|
} = useI18n();
|
|
32
34
|
const {
|
|
33
|
-
oxyServices
|
|
34
|
-
user
|
|
35
|
+
oxyServices
|
|
35
36
|
} = useOxy();
|
|
36
37
|
const queryClient = useQueryClient();
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
enabled: !keyed
|
|
40
|
-
});
|
|
38
|
+
const state = useAccountSecurityState();
|
|
39
|
+
const [removing, setRemoving] = useState(false);
|
|
41
40
|
const [password, setPassword] = useState('');
|
|
42
41
|
const [repeat, setRepeat] = useState('');
|
|
43
42
|
const [signOutOthers, setSignOutOthers] = useState(false);
|
|
44
|
-
if (keyed) {
|
|
43
|
+
if (state.keyed) {
|
|
45
44
|
return /*#__PURE__*/_jsx(OxyAuthScreen, {
|
|
46
45
|
children: /*#__PURE__*/_jsx(OxyAuthScreenHeader, {
|
|
47
46
|
title: t('signInSecurity.password.title'),
|
|
@@ -49,8 +48,38 @@ export const OxyPasswordPanel = ({
|
|
|
49
48
|
})
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const fallback = accountSecurityFallback(state, t('signInSecurity.password.title'), t);
|
|
52
|
+
if (fallback || !state.methods.data) return fallback;
|
|
53
|
+
const {
|
|
54
|
+
hasEmail,
|
|
55
|
+
hasPassword,
|
|
56
|
+
totpEnabled
|
|
57
|
+
} = state.methods.data;
|
|
58
|
+
const refresh = () => void queryClient.invalidateQueries({
|
|
59
|
+
queryKey: queryKeys.signInMethods.all
|
|
60
|
+
});
|
|
61
|
+
if (removing) {
|
|
62
|
+
return /*#__PURE__*/_jsx(ReauthStep, {
|
|
63
|
+
title: t('signInSecurity.password.removeTitle'),
|
|
64
|
+
description: t('signInSecurity.password.removeDescription'),
|
|
65
|
+
action: "change_password",
|
|
66
|
+
allowPassword: true,
|
|
67
|
+
totpEnabled: totpEnabled,
|
|
68
|
+
submitLabel: t('signInSecurity.password.remove'),
|
|
69
|
+
destructive: true,
|
|
70
|
+
onSubmit: async reauth => {
|
|
71
|
+
await oxyServices.auth.password.remove(reauth);
|
|
72
|
+
refresh();
|
|
73
|
+
toast.success(t('signInSecurity.password.removed'));
|
|
74
|
+
setRemoving(false);
|
|
75
|
+
onDone?.();
|
|
76
|
+
},
|
|
77
|
+
secondary: {
|
|
78
|
+
label: t('common.cancel'),
|
|
79
|
+
onPress: () => setRemoving(false)
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
54
83
|
return /*#__PURE__*/_jsxs(ReauthStep, {
|
|
55
84
|
title: hasPassword ? t('signInSecurity.password.changeTitle') : t('signInSecurity.password.setTitle'),
|
|
56
85
|
description: t('signInSecurity.password.description', {
|
|
@@ -58,7 +87,8 @@ export const OxyPasswordPanel = ({
|
|
|
58
87
|
}),
|
|
59
88
|
action: "change_password",
|
|
60
89
|
allowPassword: hasPassword,
|
|
61
|
-
|
|
90
|
+
allowEmail: hasEmail,
|
|
91
|
+
totpEnabled: totpEnabled,
|
|
62
92
|
submitLabel: t('signInSecurity.password.save'),
|
|
63
93
|
validate: () => {
|
|
64
94
|
if (password.length < PASSWORD_MIN_LENGTH || password.length > PASSWORD_MAX_LENGTH) {
|
|
@@ -74,9 +104,7 @@ export const OxyPasswordPanel = ({
|
|
|
74
104
|
reauth,
|
|
75
105
|
revokeOtherSessions: signOutOthers
|
|
76
106
|
});
|
|
77
|
-
|
|
78
|
-
queryKey: queryKeys.signInMethods.all
|
|
79
|
-
});
|
|
107
|
+
refresh();
|
|
80
108
|
toast.success(t('signInSecurity.password.saved'));
|
|
81
109
|
onDone?.();
|
|
82
110
|
},
|
|
@@ -111,7 +139,11 @@ export const OxyPasswordPanel = ({
|
|
|
111
139
|
onCheckedChange: setSignOutOthers,
|
|
112
140
|
testID: "password-sign-out-others"
|
|
113
141
|
})
|
|
114
|
-
})
|
|
142
|
+
}), hasPassword && hasEmail ? /*#__PURE__*/_jsx(SubtleLink, {
|
|
143
|
+
label: t('signInSecurity.password.remove'),
|
|
144
|
+
onPress: () => setRemoving(true),
|
|
145
|
+
testID: "password-remove"
|
|
146
|
+
}) : null]
|
|
115
147
|
});
|
|
116
148
|
};
|
|
117
149
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","StyleSheet","Field","Switch","toast","PASSWORD_MAX_LENGTH","PASSWORD_MIN_LENGTH","useQueryClient","useOxy","
|
|
1
|
+
{"version":3,"names":["useState","StyleSheet","Field","Switch","toast","PASSWORD_MAX_LENGTH","PASSWORD_MIN_LENGTH","useQueryClient","useOxy","queryKeys","useI18n","SubtleLink","OxyAuthScreen","OxyAuthScreenHeader","ReauthStep","AccountFlowField","accountSecurityFallback","useAccountSecurityState","jsx","_jsx","jsxs","_jsxs","OxyPasswordPanel","onDone","onCancel","t","oxyServices","queryClient","state","removing","setRemoving","password","setPassword","repeat","setRepeat","signOutOthers","setSignOutOthers","keyed","children","title","description","fallback","methods","data","hasEmail","hasPassword","totpEnabled","refresh","invalidateQueries","queryKey","signInMethods","all","action","allowPassword","submitLabel","destructive","onSubmit","reauth","auth","remove","success","secondary","label","onPress","min","allowEmail","validate","length","set","newPassword","revokeOtherSessions","undefined","value","onChange","error","autoComplete","secureTextEntry","testID","autoFocus","style","styles","row","checked","onCheckedChange","create","flexDirection","alignItems","justifyContent","gap"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/OxyPasswordPanel.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACnF,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,MAAM,QAAQ,oCAAiC;AACxD,SAASC,SAAS,QAAQ,kCAA+B;AACzD,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,oBAAiB;AACpE,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,uBAAuB,EAAEC,uBAAuB,QAAQ,2BAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS1F,OAAO,MAAMC,gBAAiD,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAS,CAAC,KAAK;EACzF,MAAM;IAAEC;EAAE,CAAC,GAAGf,OAAO,CAAC,CAAC;EACvB,MAAM;IAAEgB;EAAY,CAAC,GAAGlB,MAAM,CAAC,CAAC;EAChC,MAAMmB,WAAW,GAAGpB,cAAc,CAAC,CAAC;EACpC,MAAMqB,KAAK,GAAGX,uBAAuB,CAAC,CAAC;EACvC,MAAM,CAACY,QAAQ,EAAEC,WAAW,CAAC,GAAG9B,QAAQ,CAAC,KAAK,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KAAK,EAAErC,CAAC,CAAC,gCAAgC,CAAE;MAC3CsC,OAAO,EAAEA,CAAA,KAAMjC,WAAW,CAAC,IAAI,CAAE;MACjC+C,MAAM,EAAC;IAAiB,CACzB,CAAC,GACA,IAAI;EAAA,CACE,CAAC;AAEjB,CAAC;AAED,MAAMG,MAAM,GAAG/E,UAAU,CAACmF,MAAM,CAAC;EAC/BH,GAAG,EAAE;IACHI,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* "Sign-in & security": every way the signed-in account signs in, each with
|
|
5
|
+
* its state, and every place it is signed in. One page, rendered by the
|
|
6
|
+
* account dialog's "Manage your account" (`SignInSecurity`) and by the
|
|
7
|
+
* Accounts app's security page.
|
|
8
|
+
*
|
|
9
|
+
* Each method opens its own panel: the email (`SignInEmail`), the password
|
|
10
|
+
* (`SignInPassword`), the authenticator app (`SignInAuthenticator`) and
|
|
11
|
+
* linking Commons (`LinkCommons`). An account with a Commons key signs in with
|
|
12
|
+
* Commons, so it sees only that; an organization, project or bot has no
|
|
13
|
+
* methods of its own, only its sessions.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { View } from 'react-native';
|
|
17
|
+
import { GroupedSection, GroupedSectionItem } from '@oxy.so/bloom/grouped-section';
|
|
18
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
19
|
+
import { useOxy } from "../../context/oxyRuntimeContext.js";
|
|
20
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
21
|
+
import { SettingsIcon } from "../SettingsIcon.js";
|
|
22
|
+
import { AccountFlowNotice } from "./accountFlowParts.js";
|
|
23
|
+
import { useAccountSecurityState } from "./accountSecurityState.js";
|
|
24
|
+
import { SessionsSection } from "./SessionsSection.js";
|
|
25
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
export const OxySignInSecurityPanel = ({
|
|
27
|
+
onOpen
|
|
28
|
+
}) => {
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const {
|
|
31
|
+
t
|
|
32
|
+
} = useI18n();
|
|
33
|
+
const {
|
|
34
|
+
user,
|
|
35
|
+
showBottomSheet
|
|
36
|
+
} = useOxy();
|
|
37
|
+
const {
|
|
38
|
+
keyed,
|
|
39
|
+
personal,
|
|
40
|
+
methods
|
|
41
|
+
} = useAccountSecurityState();
|
|
42
|
+
const open = route => () => onOpen ? onOpen(route) : showBottomSheet?.(route);
|
|
43
|
+
const on = theme.colors.success;
|
|
44
|
+
const off = theme.colors.textTertiary;
|
|
45
|
+
const renderMethods = () => {
|
|
46
|
+
if (keyed) {
|
|
47
|
+
return /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
48
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
49
|
+
name: "key",
|
|
50
|
+
color: on
|
|
51
|
+
}),
|
|
52
|
+
title: t('signInSecurity.commons.title'),
|
|
53
|
+
description: t('linkCommons.already'),
|
|
54
|
+
showChevron: false,
|
|
55
|
+
disabled: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (!personal) {
|
|
59
|
+
return /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
60
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
61
|
+
name: "information",
|
|
62
|
+
color: off
|
|
63
|
+
}),
|
|
64
|
+
title: t('signInSecurity.notPersonal'),
|
|
65
|
+
showChevron: false,
|
|
66
|
+
disabled: true
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (!methods.data) {
|
|
70
|
+
return methods.isError ? /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
71
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
72
|
+
name: "alert-circle",
|
|
73
|
+
color: theme.colors.error
|
|
74
|
+
}),
|
|
75
|
+
title: t('signInSecurity.loadFailed'),
|
|
76
|
+
description: t('signInSecurity.retry'),
|
|
77
|
+
onPress: () => void methods.refetch(),
|
|
78
|
+
testID: "sign-in-security-retry"
|
|
79
|
+
}) : /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
80
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
81
|
+
name: "sync",
|
|
82
|
+
color: theme.colors.primary
|
|
83
|
+
}),
|
|
84
|
+
title: t('common.status.loading'),
|
|
85
|
+
showChevron: false,
|
|
86
|
+
disabled: true
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const {
|
|
90
|
+
hasEmail,
|
|
91
|
+
hasPassword,
|
|
92
|
+
totpEnabled,
|
|
93
|
+
backupCodesRemaining
|
|
94
|
+
} = methods.data;
|
|
95
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
96
|
+
children: [/*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
97
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
98
|
+
name: "email",
|
|
99
|
+
color: hasEmail ? on : off
|
|
100
|
+
}),
|
|
101
|
+
title: t('signInSecurity.email.title'),
|
|
102
|
+
description: hasEmail ? user?.email ?? t('signInSecurity.status.on') : t('signInSecurity.email.none'),
|
|
103
|
+
onPress: open('SignInEmail'),
|
|
104
|
+
testID: "sign-in-security-email"
|
|
105
|
+
}), /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
106
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
107
|
+
name: "key",
|
|
108
|
+
color: hasPassword ? on : off
|
|
109
|
+
}),
|
|
110
|
+
title: t('signInSecurity.password.title'),
|
|
111
|
+
description: hasPassword ? t('signInSecurity.status.on') : t('signInSecurity.password.row'),
|
|
112
|
+
onPress: open('SignInPassword'),
|
|
113
|
+
testID: "sign-in-security-password"
|
|
114
|
+
}), /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
115
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
116
|
+
name: "shield-check",
|
|
117
|
+
color: totpEnabled ? on : off
|
|
118
|
+
}),
|
|
119
|
+
title: t('signInSecurity.totp.title'),
|
|
120
|
+
description: totpEnabled ? t('signInSecurity.totp.onWithCodes', {
|
|
121
|
+
count: backupCodesRemaining
|
|
122
|
+
}) : t('signInSecurity.totp.row'),
|
|
123
|
+
onPress: open('SignInAuthenticator'),
|
|
124
|
+
testID: "sign-in-security-totp"
|
|
125
|
+
}), /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
126
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
127
|
+
name: "link",
|
|
128
|
+
color: theme.colors.primary
|
|
129
|
+
}),
|
|
130
|
+
title: t('linkCommons.title'),
|
|
131
|
+
description: t('linkCommons.row'),
|
|
132
|
+
onPress: open('LinkCommons'),
|
|
133
|
+
testID: "sign-in-security-commons"
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
const noEmail = personal && !keyed && methods.data?.hasEmail === false;
|
|
138
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
139
|
+
children: [/*#__PURE__*/_jsx(GroupedSection, {
|
|
140
|
+
title: t('signInSecurity.methodsTitle'),
|
|
141
|
+
children: renderMethods()
|
|
142
|
+
}), noEmail ? /*#__PURE__*/_jsx(AccountFlowNotice, {
|
|
143
|
+
type: "warning",
|
|
144
|
+
testID: "sign-in-security-no-email",
|
|
145
|
+
children: t('signInSecurity.noEmailWarning')
|
|
146
|
+
}) : null, /*#__PURE__*/_jsx(SessionsSection, {})]
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=OxySignInSecurityPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","GroupedSection","GroupedSectionItem","useTheme","useOxy","useI18n","SettingsIcon","AccountFlowNotice","useAccountSecurityState","SessionsSection","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","OxySignInSecurityPanel","onOpen","theme","t","user","showBottomSheet","keyed","personal","methods","open","route","on","colors","success","off","textTertiary","renderMethods","icon","name","color","title","description","showChevron","disabled","data","isError","error","onPress","refetch","testID","primary","hasEmail","hasPassword","totpEnabled","backupCodesRemaining","children","email","count","noEmail","type"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/OxySignInSecurityPanel.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,EAAEC,kBAAkB,QAAQ,+BAA+B;AAClF,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,MAAM,QAAQ,oCAAiC;AACxD,SAASC,OAAO,QAAQ,wBAAqB;AAE7C,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,iBAAiB,QAAQ,uBAAoB;AACtD,SAASC,uBAAuB,QAAQ,2BAAwB;AAChE,SAASC,eAAe,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAepD,OAAO,MAAMC,sBAA6D,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EAC3F,MAAMC,KAAK,GAAGf,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEgB;EAAE,CAAC,GAAGd,OAAO,CAAC,CAAC;EACvB,MAAM;IAAEe,IAAI;IAAEC;EAAgB,CAAC,GAAGjB,MAAM,CAAC,CAAC;EAC1C,MAAM;IAAEkB,KAAK;IAAEC,QAAQ;IAAEC;EAAQ,CAAC,GAAGhB,uBAAuB,CAAC,CAAC;EAC9D,MAAMiB,IAAI,GAAIC,KAA0B,IAAK,MAC3CT,MAAM,GAAGA,MAAM,CAACS,KAAK,CAAC,GAAGL,eAAe,GAAGK,KAAK,CAAC;EACnD,M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AA,CAACF,eAAe,IAAE,CAAC;EAAA,CACf,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* "Confirm it's you": the fresh proof a sensitive change carries (`reauth`) —
|
|
5
5
|
* a code sent to the account's email for THIS change, or the current password
|
|
6
|
-
* where the change accepts one
|
|
7
|
-
*
|
|
6
|
+
* where the change accepts one (the only proof of an account without an
|
|
7
|
+
* email) — plus the authenticator's code (or a backup code) when the account
|
|
8
|
+
* has one. The screen that needs it puts its own fields
|
|
8
9
|
* above (`children`) and names its own action; this owns the proof.
|
|
9
10
|
*/
|
|
10
11
|
|
|
@@ -23,6 +24,7 @@ export const ReauthStep = ({
|
|
|
23
24
|
description,
|
|
24
25
|
action,
|
|
25
26
|
allowPassword = false,
|
|
27
|
+
allowEmail = true,
|
|
26
28
|
totpEnabled,
|
|
27
29
|
submitLabel,
|
|
28
30
|
destructive,
|
|
@@ -37,7 +39,7 @@ export const ReauthStep = ({
|
|
|
37
39
|
const {
|
|
38
40
|
oxyServices
|
|
39
41
|
} = useOxy();
|
|
40
|
-
const [mode, setMode] = useState(allowPassword ? 'password' : 'email');
|
|
42
|
+
const [mode, setMode] = useState(allowPassword || !allowEmail ? 'password' : 'email');
|
|
41
43
|
const [verificationId, setVerificationId] = useState(null);
|
|
42
44
|
const [emailCode, setEmailCode] = useState('');
|
|
43
45
|
const [password, setPassword] = useState('');
|
|
@@ -188,7 +190,7 @@ export const ReauthStep = ({
|
|
|
188
190
|
onPress: sendCode,
|
|
189
191
|
disabled: pending,
|
|
190
192
|
testID: "reauth-resend"
|
|
191
|
-
}) : null, allowPassword ? /*#__PURE__*/_jsx(SubtleLink, {
|
|
193
|
+
}) : null, allowPassword && allowEmail ? /*#__PURE__*/_jsx(SubtleLink, {
|
|
192
194
|
label: mode === 'password' ? t('reauth.useEmail') : t('reauth.usePassword'),
|
|
193
195
|
onPress: () => {
|
|
194
196
|
setError(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","View","Button","EMAIL_CODE_LENGTH","TOTP_DIGITS","useOxy","useI18n","SubtleLink","OxyAuthScreen","OxyAuthScreenHeader","AccountFlowAction","AccountFlowCodeField","AccountFlowErrorLine","AccountFlowField","AccountFlowNote","AccountFlowNotice","BACKUP_CODE_LENGTH","describeSignInError","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ReauthStep","title","description","action","allowPassword","totpEnabled","submitLabel","destructive","validate","onSubmit","secondary","children","t","oxyServices","mode","setMode","verificationId","setVerificationId","emailCode","setEmailCode","password","setPassword","totpCode","setTotpCode","useBackupCode","setUseBackupCode","pending","setPending","error","setError","run","work","catch","reason","finally","sendCode","started","auth","requestReauthCode","submit","invalid","totp","trim","proof","code","replace","length","needsCode","label","value","onChange","disabled","autoComplete","secureTextEntry","autoFocus","testID","type","groupEvery","undefined","onPress","message","style","flexDirection","alignItems","gap","appearance","tone","size","flex","minWidth"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/ReauthStep.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,0BAA0B;AACzE,SAASC,MAAM,QAAQ,oCAAiC;AACxD,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,oBAAiB;AACpE,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,mBAAmB,QACd,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["useState","View","Button","EMAIL_CODE_LENGTH","TOTP_DIGITS","useOxy","useI18n","SubtleLink","OxyAuthScreen","OxyAuthScreenHeader","AccountFlowAction","AccountFlowCodeField","AccountFlowErrorLine","AccountFlowField","AccountFlowNote","AccountFlowNotice","BACKUP_CODE_LENGTH","describeSignInError","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ReauthStep","title","description","action","allowPassword","allowEmail","totpEnabled","submitLabel","destructive","validate","onSubmit","secondary","children","t","oxyServices","mode","setMode","verificationId","setVerificationId","emailCode","setEmailCode","password","setPassword","totpCode","setTotpCode","useBackupCode","setUseBackupCode","pending","setPending","error","setError","run","work","catch","reason","finally","sendCode","started","auth","requestReauthCode","submit","invalid","totp","trim","proof","code","replace","length","needsCode","label","value","onChange","disabled","autoComplete","secureTextEntry","autoFocus","testID","type","groupEvery","undefined","onPress","message","style","flexDirection","alignItems","gap","appearance","tone","size","flex","minWidth"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/ReauthStep.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,0BAA0B;AACzE,SAASC,MAAM,QAAQ,oCAAiC;AACxD,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,oBAAiB;AACpE,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,mBAAmB,QACd,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AA4B5B,OAAO,MAAMC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oB,CAAE;MAC5E+C,OAAO,EAAEA,CAAA,KAAM;QACb9B,QAAQ,CAAC,IAAI,CAAC;QACdd,OAAO,CAACD,IAAI,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;MACrD,CAAE;MACFqC,QAAQ,EAAEzB,OAAQ;MAClB6B,MAAM,EAAC;IAAsB,CAC9B,CAAC,GACA,IAAI;EAAA,CACK,CAAC;AAEpB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* "Where you're signed in": the signed-in account's sessions on every device,
|
|
5
|
+
* from the server (`oxy.devices.sessions`). Removing one ends that session;
|
|
6
|
+
* "Sign out of all other devices" ends every session but this one
|
|
7
|
+
* (`oxy.devices.logoutAll`) — it never signs this device out.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useCallback, useState } from 'react';
|
|
11
|
+
import { GroupedSection, GroupedSectionItem } from '@oxy.so/bloom/grouped-section';
|
|
12
|
+
import { SpinnerIcon } from '@oxy.so/bloom/loading';
|
|
13
|
+
import { surfaces } from '@oxy.so/bloom/surfaces';
|
|
14
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
15
|
+
import { toast } from '@oxy.so/bloom/toast';
|
|
16
|
+
import { logger as loggerUtil } from '@oxy.so/core';
|
|
17
|
+
import { useOxy } from "../../context/oxyRuntimeContext.js";
|
|
18
|
+
import { useDeviceSessions } from "../../hooks/queries/useServicesQueries.js";
|
|
19
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
20
|
+
import Ionicons from "../../icons/Ionicons.js";
|
|
21
|
+
import { deviceSessionTitle } from "../../utils/deviceSessionTitle.js";
|
|
22
|
+
import { SettingsIcon } from "../SettingsIcon.js";
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
const formatRelative = dateString => {
|
|
25
|
+
if (!dateString) {
|
|
26
|
+
return '—';
|
|
27
|
+
}
|
|
28
|
+
const date = new Date(dateString);
|
|
29
|
+
const now = new Date();
|
|
30
|
+
const diffMs = date.getTime() - now.getTime();
|
|
31
|
+
const absMin = Math.abs(diffMs) / 60000;
|
|
32
|
+
const isFuture = diffMs > 0;
|
|
33
|
+
if (absMin < 1) {
|
|
34
|
+
return isFuture ? 'in moments' : 'just now';
|
|
35
|
+
}
|
|
36
|
+
if (absMin < 60) {
|
|
37
|
+
const v = Math.floor(absMin);
|
|
38
|
+
return isFuture ? `in ${v}m` : `${v}m ago`;
|
|
39
|
+
}
|
|
40
|
+
const hrs = absMin / 60;
|
|
41
|
+
if (hrs < 24) {
|
|
42
|
+
const v = Math.floor(hrs);
|
|
43
|
+
return isFuture ? `in ${v}h` : `${v}h ago`;
|
|
44
|
+
}
|
|
45
|
+
const days = hrs / 24;
|
|
46
|
+
if (days < 7) {
|
|
47
|
+
const v = Math.floor(days);
|
|
48
|
+
return isFuture ? `in ${v}d` : `${v}d ago`;
|
|
49
|
+
}
|
|
50
|
+
return date.toLocaleDateString();
|
|
51
|
+
};
|
|
52
|
+
export const SessionsSection = () => {
|
|
53
|
+
const bloomTheme = useTheme();
|
|
54
|
+
const {
|
|
55
|
+
t
|
|
56
|
+
} = useI18n();
|
|
57
|
+
const {
|
|
58
|
+
isAuthenticated,
|
|
59
|
+
oxyServices,
|
|
60
|
+
activeSessionId
|
|
61
|
+
} = useOxy();
|
|
62
|
+
const {
|
|
63
|
+
data: deviceSessions,
|
|
64
|
+
isLoading: deviceSessionsLoading,
|
|
65
|
+
refetch: refetchDeviceSessions
|
|
66
|
+
} = useDeviceSessions({
|
|
67
|
+
enabled: isAuthenticated && !!activeSessionId
|
|
68
|
+
});
|
|
69
|
+
const [removingDeviceId, setRemovingDeviceId] = useState(null);
|
|
70
|
+
const [signingOutAllDevices, setSigningOutAllDevices] = useState(false);
|
|
71
|
+
const deviceRows = deviceSessions ?? [];
|
|
72
|
+
const otherDevices = deviceRows.filter(d => !d.isCurrent);
|
|
73
|
+
const confirmRemoveDevice = useCallback(async device => {
|
|
74
|
+
if (!activeSessionId) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const confirmed = await surfaces.confirm({
|
|
78
|
+
title: t('manageAccount.confirms.removeDeviceTitle') || 'Remove device',
|
|
79
|
+
description: t('manageAccount.confirms.removeDevice', {
|
|
80
|
+
name: deviceSessionTitle(device, t)
|
|
81
|
+
}),
|
|
82
|
+
confirmLabel: t('common.remove') || 'Remove',
|
|
83
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
84
|
+
destructive: true
|
|
85
|
+
});
|
|
86
|
+
if (!confirmed) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
setRemovingDeviceId(device.sessionId);
|
|
90
|
+
try {
|
|
91
|
+
await oxyServices.session.logout(activeSessionId, device.sessionId);
|
|
92
|
+
await refetchDeviceSessions();
|
|
93
|
+
toast.success(t('manageAccount.toasts.deviceRemoved', {
|
|
94
|
+
name: deviceSessionTitle(device, t)
|
|
95
|
+
}));
|
|
96
|
+
} catch (error) {
|
|
97
|
+
loggerUtil.warn('Remove device failed', {
|
|
98
|
+
component: 'SessionsSection'
|
|
99
|
+
}, error);
|
|
100
|
+
toast.error(t('manageAccount.toasts.deviceRemoveFailed') || 'Failed to remove device');
|
|
101
|
+
} finally {
|
|
102
|
+
setRemovingDeviceId(null);
|
|
103
|
+
}
|
|
104
|
+
}, [activeSessionId, oxyServices, refetchDeviceSessions, t]);
|
|
105
|
+
const handleSignOutAllDevices = useCallback(async () => {
|
|
106
|
+
if (!activeSessionId || signingOutAllDevices) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const confirmed = await surfaces.confirm({
|
|
110
|
+
title: t('manageAccount.confirms.signOutAllDevicesTitle') || 'Sign out of all other devices',
|
|
111
|
+
description: t('manageAccount.confirms.signOutAllDevices', {
|
|
112
|
+
count: otherDevices.length
|
|
113
|
+
}) || `End ${otherDevices.length} other device session(s)? This won't sign you out here.`,
|
|
114
|
+
confirmLabel: t('common.actions.signOut') || 'Sign out',
|
|
115
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
116
|
+
destructive: true
|
|
117
|
+
});
|
|
118
|
+
if (!confirmed) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
setSigningOutAllDevices(true);
|
|
122
|
+
try {
|
|
123
|
+
await oxyServices.devices.logoutAll(activeSessionId);
|
|
124
|
+
await refetchDeviceSessions();
|
|
125
|
+
toast.success(t('manageAccount.toasts.allDevicesSignedOut') || 'Signed out from all other devices');
|
|
126
|
+
} catch (error) {
|
|
127
|
+
loggerUtil.warn('Sign out all devices failed', {
|
|
128
|
+
component: 'SessionsSection'
|
|
129
|
+
}, error);
|
|
130
|
+
toast.error(t('manageAccount.toasts.allDevicesFailed') || 'Failed to sign out from other devices');
|
|
131
|
+
} finally {
|
|
132
|
+
setSigningOutAllDevices(false);
|
|
133
|
+
}
|
|
134
|
+
}, [activeSessionId, signingOutAllDevices, otherDevices.length, oxyServices, refetchDeviceSessions, t]);
|
|
135
|
+
return /*#__PURE__*/_jsxs(GroupedSection, {
|
|
136
|
+
title: t('manageAccount.sections.sessions') || 'Sessions & devices',
|
|
137
|
+
children: [deviceSessionsLoading ? /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
138
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
139
|
+
name: "sync",
|
|
140
|
+
color: bloomTheme.colors.primary
|
|
141
|
+
}),
|
|
142
|
+
title: t('manageAccount.sessions.loading') || 'Loading sessions…',
|
|
143
|
+
rightElement: null,
|
|
144
|
+
showChevron: false,
|
|
145
|
+
disabled: true
|
|
146
|
+
}) : deviceRows.length === 0 ? /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
147
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
148
|
+
name: "cellphone",
|
|
149
|
+
color: bloomTheme.colors.textTertiary
|
|
150
|
+
}),
|
|
151
|
+
title: t('manageAccount.sessions.empty') || 'No active sessions',
|
|
152
|
+
showChevron: false,
|
|
153
|
+
disabled: true
|
|
154
|
+
}) : deviceRows.map(device => /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
155
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
156
|
+
name: device.isCurrent ? 'cellphone' : 'cellphone-basic',
|
|
157
|
+
color: device.isCurrent ? bloomTheme.colors.success : bloomTheme.colors.primary
|
|
158
|
+
}),
|
|
159
|
+
title: deviceSessionTitle(device, t),
|
|
160
|
+
description: t('manageAccount.sessions.lastActive', {
|
|
161
|
+
relative: formatRelative(device.lastActive)
|
|
162
|
+
}) || `Last active ${formatRelative(device.lastActive)}`,
|
|
163
|
+
onPress: device.isCurrent ? undefined : () => confirmRemoveDevice(device),
|
|
164
|
+
disabled: device.isCurrent || removingDeviceId === device.sessionId,
|
|
165
|
+
rightElement: !device.isCurrent ? removingDeviceId === device.sessionId ? /*#__PURE__*/_jsx(SpinnerIcon, {
|
|
166
|
+
color: bloomTheme.colors.error,
|
|
167
|
+
size: 16
|
|
168
|
+
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
169
|
+
name: "log-out-outline",
|
|
170
|
+
size: 18,
|
|
171
|
+
color: bloomTheme.colors.error
|
|
172
|
+
}) : undefined,
|
|
173
|
+
showChevron: false
|
|
174
|
+
}, `device-${device.sessionId}`)), otherDevices.length > 0 ? /*#__PURE__*/_jsx(GroupedSectionItem, {
|
|
175
|
+
icon: /*#__PURE__*/_jsx(SettingsIcon, {
|
|
176
|
+
name: "logout",
|
|
177
|
+
color: bloomTheme.colors.error
|
|
178
|
+
}),
|
|
179
|
+
title: t('manageAccount.sessions.signOutAllOnThisDevice') || 'Sign out of all other devices',
|
|
180
|
+
description: t('manageAccount.sessions.signOutAllSubtitle', {
|
|
181
|
+
count: otherDevices.length
|
|
182
|
+
}) || `End ${otherDevices.length} other device session(s)`,
|
|
183
|
+
onPress: handleSignOutAllDevices,
|
|
184
|
+
destructive: true,
|
|
185
|
+
showChevron: false,
|
|
186
|
+
disabled: signingOutAllDevices,
|
|
187
|
+
rightElement: signingOutAllDevices ? /*#__PURE__*/_jsx(SpinnerIcon, {
|
|
188
|
+
color: bloomTheme.colors.error,
|
|
189
|
+
size: 16
|
|
190
|
+
}) : undefined
|
|
191
|
+
}) : null]
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=SessionsSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useState","GroupedSection","GroupedSectionItem","SpinnerIcon","surfaces","useTheme","toast","logger","loggerUtil","useOxy","useDeviceSessions","useI18n","Ionicons","deviceSessionTitle","SettingsIcon","jsx","_jsx","jsxs","_jsxs","formatRelative","dateString","date","Date","now","diffMs","getTime","absMin","Math","abs","isFuture","v","floor","hrs","days","toLocaleDateString","SessionsSection","bloomTheme","t","isAuthenticated","oxyServices","activeSessionId","data","deviceSessions","isLoading","deviceSessionsLoading","refetch","refetchDeviceSessions","enabled","removingDeviceId","setRemovingDeviceId","signingOutAllDevices","setSigningOutAllDevices","deviceRows","otherDevices","filter","d","isCurrent","confirmRemoveDevice","device","confirmed","confirm","title","description","name","confirmLabel","cancelLabel","destructive","sessionId","session","logout","success","error","warn","component","handleSignOutAllDevices","count","length","devices","logoutAll","children","icon","color","colors","primary","rightElement","showChevron","disabled","textTertiary","map","relative","lastActive","onPress","undefined","size"],"sourceRoot":"../../../../../src","sources":["ui/components/signIn/SessionsSection.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,cAAc,EAAEC,kBAAkB,QAAQ,+BAA+B;AAClF,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,SAAS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ACV,CAAC1B,MAAM,CAACF,SAAS,GACfR,gBAAgB,KAAKU,MAAM,CAACS,SAAS,gBACnCnD,IAAA,CAACb,WAAW;QAAC8E,KAAK,EAAE7C,UAAU,CAAC8C,MAAM,CAACX,KAAM;QAACsB,IAAI,EAAE;MAAG,CAAE,CAAC,gBAEzD7E,IAAA,CAACJ,QAAQ;QAACmD,IAAI,EAAC,iBAAiB;QAAC8B,IAAI,EAAE,EAAG;QAACZ,KAAK,EAAE7C,UAAU,CAAC8C,MAAM,CAACX;MAAM,CAAE,CAC7E,GACCqB,SACL;MACDP,WAAW,EAAE;IAAM,GAxBd,UAAU3B,MAAM,CAACS,SAAS,EAyBhC,CACF,CACF,EACAd,YAAY,CAACuB,MAAM,GAAG,CAAC,gBACtB5D,IAAA,CAACd,kBAAkB;MACjB8E,IAAI,eAAEhE,IAAA,CAACF,YAAY;QAACiD,IAAI,EAAC,QAAQ;QAACkB,KAAK,EAAE7C,UAAU,CAAC8C,MAAM,CAACX;MAAM,CAAE,CAAE;MACrEV,KAAK,EACHxB,CAAC,CAAC,+CAA+C,CAAC,IAAI,+BACvD;MACDyB,WAAW,EACTzB,CAAC,CAAC,2CAA2C,EAAE;QAC7CsC,KAAK,EAAEtB,YAAY,CAACuB;MACtB,CAAC,CAAC,IAAI,OAAOvB,YAAY,CAACuB,MAAM,0BACjC;MACDe,OAAO,EAAEjB,uBAAwB;MACjCR,WAAW;MACXmB,WAAW,EAAE,KAAM;MACnBC,QAAQ,EAAEpC,oBAAqB;MAC/BkC,YAAY,EACVlC,oBAAoB,gBAClBlC,IAAA,CAACb,WAAW;QAAC8E,KAAK,EAAE7C,UAAU,CAAC8C,MAAM,CAACX,KAAM;QAACsB,IAAI,EAAE;MAAG,CAAE,CAAC,GACvDD;IACL,CACF,CAAC,GACA,IAAI;EAAA,CACM,CAAC;AAErB,CAAC","ignoreList":[]}
|
|
@@ -76,6 +76,12 @@ export function describeSignInError(error, t) {
|
|
|
76
76
|
return t('signup.username.taken');
|
|
77
77
|
case SIGN_IN_ERROR_CODES.emailAccountsFull:
|
|
78
78
|
return t('signin.errors.emailAccountsFull');
|
|
79
|
+
case SIGN_IN_ERROR_CODES.lastSignInMethod:
|
|
80
|
+
return t('signInSecurity.errors.lastSignInMethod');
|
|
81
|
+
case SIGN_IN_ERROR_CODES.passwordRequired:
|
|
82
|
+
return t('signInSecurity.errors.passwordRequired');
|
|
83
|
+
case SIGN_IN_ERROR_CODES.emailUnchanged:
|
|
84
|
+
return t('signInSecurity.errors.emailUnchanged');
|
|
79
85
|
case EMAIL_VERIFICATION_ERROR_CODES.codeInvalid:
|
|
80
86
|
return t('emailCode.errors.codeInvalid');
|
|
81
87
|
case EMAIL_VERIFICATION_ERROR_CODES.tooManyAttempts:
|