@oxyhq/services 16.0.0 → 17.0.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/lib/commonjs/index.js +21 -51
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -14
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js +764 -0
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +11 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +25 -112
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
- package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +106 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +19 -30
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +5 -40
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +0 -2
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +10 -2
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/index.js +18 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +1 -2
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialog.js +761 -0
- package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +11 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +10 -21
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +26 -112
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +294 -0
- package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +107 -3
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/useAuth.js +19 -30
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +1 -5
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +81 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +0 -2
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +10 -2
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -11
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -4
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +35 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +13 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -5
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.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/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +9 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -11
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -4
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +35 -0
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts +13 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +2 -5
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.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/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +9 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +21 -26
- package/src/ui/client.ts +0 -4
- package/src/ui/components/OxyAccountDialog.tsx +760 -0
- package/src/ui/components/OxyProvider.tsx +12 -6
- package/src/ui/components/OxySignInButton.tsx +10 -21
- package/src/ui/components/ProfileButton.tsx +23 -126
- package/src/ui/components/RequireOxyAuth.tsx +266 -0
- package/src/ui/context/OxyContext.tsx +146 -7
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/useAuth.ts +19 -31
- package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
- package/src/ui/index.ts +2 -5
- package/src/ui/navigation/accountDialogManager.ts +84 -0
- package/src/ui/navigation/routes.ts +0 -4
- package/src/ui/screens/ManageAccountScreen.tsx +3 -2
- package/src/ui/session/createSessionClient.ts +9 -1
- package/src/ui/types/navigation.ts +9 -0
- package/lib/commonjs/ui/components/AccountMenu.js +0 -598
- package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
- package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
- package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
- package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
- package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/commonjs/ui/components/SignInModal.js +0 -600
- package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
- package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/module/ui/components/AccountMenu.js +0 -593
- package/lib/module/ui/components/AccountMenu.js.map +0 -1
- package/lib/module/ui/components/AccountMenuButton.js +0 -130
- package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/module/ui/components/AccountSwitcher.js +0 -774
- package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
- package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/module/ui/components/ProfileMenu.js +0 -514
- package/lib/module/ui/components/ProfileMenu.js.map +0 -1
- package/lib/module/ui/components/SignInAccountChooser.js +0 -183
- package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/module/ui/components/SignInModal.js +0 -591
- package/lib/module/ui/components/SignInModal.js.map +0 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
- package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
- package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/module/utils/deviceFlowSignIn.js +0 -106
- package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/src/ui/components/AccountMenu.tsx +0 -645
- package/src/ui/components/AccountMenuButton.tsx +0 -126
- package/src/ui/components/AccountSwitcher.tsx +0 -751
- package/src/ui/components/AnotherDeviceQR.tsx +0 -119
- package/src/ui/components/ProfileMenu.tsx +0 -564
- package/src/ui/components/SignInAccountChooser.tsx +0 -162
- package/src/ui/components/SignInModal.tsx +0 -530
- package/src/ui/hooks/useOxyAuthSession.ts +0 -635
- package/src/ui/hooks/usePasswordSignIn.ts +0 -207
- package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
- package/src/ui/screens/OxyAuthScreen.tsx +0 -324
- package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
- package/src/utils/deviceFlowSignIn.ts +0 -152
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.usePasswordSignIn = usePasswordSignIn;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _OxyContext = require("../context/OxyContext.js");
|
|
9
|
-
var _errorHandlers = require("../utils/errorHandlers.js");
|
|
10
|
-
/**
|
|
11
|
-
* `usePasswordSignIn` — the first-party password sign-in state machine.
|
|
12
|
-
*
|
|
13
|
-
* Drives the in-app "Sign in with Oxy" password flow shared by the web
|
|
14
|
-
* `SignInModal` and the native `OxyAuthScreen`: identifier → password → optional
|
|
15
|
-
* two-factor. It is a thin UI state machine over the context methods
|
|
16
|
-
* `signInWithPassword` + `completeTwoFactorSignIn` (which own the network call,
|
|
17
|
-
* the persisted-refresh commit, and the device-set registration) — so both
|
|
18
|
-
* surfaces present an identical flow without re-implementing any transport.
|
|
19
|
-
*
|
|
20
|
-
* On a committed session `onSignedIn` fires (the modal/screen closes); the
|
|
21
|
-
* device-first cold boot / SessionClient projection then drive the app into the
|
|
22
|
-
* authenticated state.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
function usePasswordSignIn(options = {}) {
|
|
26
|
-
const {
|
|
27
|
-
signInWithPassword,
|
|
28
|
-
completeTwoFactorSignIn
|
|
29
|
-
} = (0, _OxyContext.useOxy)();
|
|
30
|
-
const {
|
|
31
|
-
onSignedIn
|
|
32
|
-
} = options;
|
|
33
|
-
const [step, setStep] = (0, _react.useState)('identifier');
|
|
34
|
-
const [identifier, setIdentifier] = (0, _react.useState)('');
|
|
35
|
-
const [password, setPassword] = (0, _react.useState)('');
|
|
36
|
-
const [code, setCode] = (0, _react.useState)('');
|
|
37
|
-
const [useBackupCode, setUseBackupCode] = (0, _react.useState)(false);
|
|
38
|
-
const [error, setError] = (0, _react.useState)(null);
|
|
39
|
-
const [isSubmitting, setIsSubmitting] = (0, _react.useState)(false);
|
|
40
|
-
const [loginToken, setLoginToken] = (0, _react.useState)(null);
|
|
41
|
-
|
|
42
|
-
// Synchronous in-flight guard. `isSubmitting` state drives the UI, but a rapid
|
|
43
|
-
// double-tap fires both handlers in the SAME tick — before React re-renders —
|
|
44
|
-
// so a state read would still see `false` on the second call and double-fire
|
|
45
|
-
// the network request (rate-limit + race). This ref is set/checked
|
|
46
|
-
// synchronously, so the second call is a true no-op.
|
|
47
|
-
const submittingRef = (0, _react.useRef)(false);
|
|
48
|
-
const surfaceError = (0, _react.useCallback)((err, defaultMessage) => {
|
|
49
|
-
setError((0, _errorHandlers.handleAuthError)(err, {
|
|
50
|
-
defaultMessage,
|
|
51
|
-
code: 'PASSWORD_SIGN_IN_ERROR'
|
|
52
|
-
}));
|
|
53
|
-
}, []);
|
|
54
|
-
const submitIdentifier = (0, _react.useCallback)(() => {
|
|
55
|
-
if (!identifier.trim()) {
|
|
56
|
-
setError('Enter your username or email');
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
setError(null);
|
|
60
|
-
setStep('password');
|
|
61
|
-
}, [identifier]);
|
|
62
|
-
const submitPassword = (0, _react.useCallback)(async () => {
|
|
63
|
-
// A second call while one is already in flight is a no-op (double-tap guard).
|
|
64
|
-
if (submittingRef.current) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (!password) {
|
|
68
|
-
setError('Enter your password');
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
setError(null);
|
|
72
|
-
submittingRef.current = true;
|
|
73
|
-
setIsSubmitting(true);
|
|
74
|
-
try {
|
|
75
|
-
const result = await signInWithPassword(identifier.trim(), password);
|
|
76
|
-
if (result.status === '2fa_required') {
|
|
77
|
-
setLoginToken(result.loginToken);
|
|
78
|
-
setCode('');
|
|
79
|
-
setUseBackupCode(false);
|
|
80
|
-
setStep('twoFactor');
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
onSignedIn?.();
|
|
84
|
-
} catch (err) {
|
|
85
|
-
surfaceError(err, 'Sign in failed');
|
|
86
|
-
} finally {
|
|
87
|
-
submittingRef.current = false;
|
|
88
|
-
setIsSubmitting(false);
|
|
89
|
-
}
|
|
90
|
-
}, [identifier, password, signInWithPassword, onSignedIn, surfaceError]);
|
|
91
|
-
const submitTwoFactor = (0, _react.useCallback)(async () => {
|
|
92
|
-
// A second call while one is already in flight is a no-op (double-tap guard).
|
|
93
|
-
if (submittingRef.current) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (!loginToken) {
|
|
97
|
-
setError('Your sign-in session expired. Start again.');
|
|
98
|
-
setStep('password');
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (!code.trim()) {
|
|
102
|
-
setError(useBackupCode ? 'Enter a backup code' : 'Enter your 6-digit code');
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
setError(null);
|
|
106
|
-
submittingRef.current = true;
|
|
107
|
-
setIsSubmitting(true);
|
|
108
|
-
try {
|
|
109
|
-
await completeTwoFactorSignIn({
|
|
110
|
-
loginToken,
|
|
111
|
-
...(useBackupCode ? {
|
|
112
|
-
backupCode: code.trim()
|
|
113
|
-
} : {
|
|
114
|
-
token: code.trim()
|
|
115
|
-
})
|
|
116
|
-
});
|
|
117
|
-
onSignedIn?.();
|
|
118
|
-
} catch (err) {
|
|
119
|
-
surfaceError(err, 'Verification failed');
|
|
120
|
-
} finally {
|
|
121
|
-
submittingRef.current = false;
|
|
122
|
-
setIsSubmitting(false);
|
|
123
|
-
}
|
|
124
|
-
}, [loginToken, code, useBackupCode, completeTwoFactorSignIn, onSignedIn, surfaceError]);
|
|
125
|
-
const back = (0, _react.useCallback)(() => {
|
|
126
|
-
setError(null);
|
|
127
|
-
setStep(current => {
|
|
128
|
-
if (current === 'twoFactor') {
|
|
129
|
-
setLoginToken(null);
|
|
130
|
-
setCode('');
|
|
131
|
-
return 'password';
|
|
132
|
-
}
|
|
133
|
-
if (current === 'password') {
|
|
134
|
-
setPassword('');
|
|
135
|
-
return 'identifier';
|
|
136
|
-
}
|
|
137
|
-
return current;
|
|
138
|
-
});
|
|
139
|
-
}, []);
|
|
140
|
-
const reset = (0, _react.useCallback)(() => {
|
|
141
|
-
setStep('identifier');
|
|
142
|
-
setIdentifier('');
|
|
143
|
-
setPassword('');
|
|
144
|
-
setCode('');
|
|
145
|
-
setUseBackupCode(false);
|
|
146
|
-
setLoginToken(null);
|
|
147
|
-
setError(null);
|
|
148
|
-
submittingRef.current = false;
|
|
149
|
-
setIsSubmitting(false);
|
|
150
|
-
}, []);
|
|
151
|
-
return (0, _react.useMemo)(() => ({
|
|
152
|
-
step,
|
|
153
|
-
identifier,
|
|
154
|
-
setIdentifier,
|
|
155
|
-
password,
|
|
156
|
-
setPassword,
|
|
157
|
-
code,
|
|
158
|
-
setCode,
|
|
159
|
-
useBackupCode,
|
|
160
|
-
setUseBackupCode,
|
|
161
|
-
error,
|
|
162
|
-
isSubmitting,
|
|
163
|
-
submitIdentifier,
|
|
164
|
-
submitPassword,
|
|
165
|
-
submitTwoFactor,
|
|
166
|
-
back,
|
|
167
|
-
reset
|
|
168
|
-
}), [step, identifier, password, code, useBackupCode, error, isSubmitting, submitIdentifier, submitPassword, submitTwoFactor, back, reset]);
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=usePasswordSignIn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_OxyContext","_errorHandlers","usePasswordSignIn","options","signInWithPassword","completeTwoFactorSignIn","useOxy","onSignedIn","step","setStep","useState","identifier","setIdentifier","password","setPassword","code","setCode","useBackupCode","setUseBackupCode","error","setError","isSubmitting","setIsSubmitting","loginToken","setLoginToken","submittingRef","useRef","surfaceError","useCallback","err","defaultMessage","handleAuthError","submitIdentifier","trim","submitPassword","current","result","status","submitTwoFactor","backupCode","token","back","reset","useMemo"],"sourceRoot":"../../../../src","sources":["ui/hooks/usePasswordSignIn.ts"],"mappings":";;;;;;AAcA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCO,SAASG,iBAAiBA,CAACC,OAAiC,GAAG,CAAC,CAAC,EAA2B;EACjG,MAAM;IAAEC,kBAAkB;IAAEC;EAAwB,CAAC,GAAG,IAAAC,kBAAM,EAAC,CAAC;EAChE,MAAM;IAAEC;EAAW,CAAC,GAAGJ,OAAO;EAE9B,MAAM,CAACK,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAC,eAAQ,EAAqB,YAAY,CAAC;EAClE,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAF,eAAQ,EAAC,EAAE,CAAC;EAChD,MAAM,CAACG,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAJ,eAAQ,EAAC,EAAE,CAAC;EAC5C,MAAM,CAACK,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAN,eAAQ,EAAC,EAAE,CAAC;EACpC,MAAM,CAACO,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAR,eAAQ,EAAC,KAAK,CAAC;EACzD,MAAM,CAACS,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAV,eAAQ,EAAgB,IAAI,CAAC;EACvD,MAAM,CAACW,YAAY,EAAEC,eAAe,CAAC,GAAG,IAAAZ,eAAQ,EAAC,KAAK,CAAC;EACvD,MAAM,CAACa,UAAU,EAAEC,aAAa,CAAC,GAA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 -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _Header = _interopRequireDefault(require("../components/Header.js"));
|
|
10
|
-
var _AccountSwitcher = require("../components/AccountSwitcher.js");
|
|
11
|
-
var _useI18n = require("../hooks/useI18n.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
/**
|
|
15
|
-
* Bottom-sheet route wrapper around {@link AccountSwitcherView}. Used when the
|
|
16
|
-
* switcher is opened as a sheet (e.g. from the "Your accounts" entry in
|
|
17
|
-
* ManageAccount) rather than as the header-chip popover (which uses the
|
|
18
|
-
* `AccountSwitcher` modal directly).
|
|
19
|
-
*/const AccountSwitcherScreen = ({
|
|
20
|
-
onClose,
|
|
21
|
-
goBack,
|
|
22
|
-
navigate
|
|
23
|
-
}) => {
|
|
24
|
-
const {
|
|
25
|
-
t
|
|
26
|
-
} = (0, _useI18n.useI18n)();
|
|
27
|
-
const close = (0, _react.useCallback)(() => {
|
|
28
|
-
(onClose ?? goBack)?.();
|
|
29
|
-
}, [onClose, goBack]);
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
31
|
-
className: "flex-1 bg-bg",
|
|
32
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Header.default, {
|
|
33
|
-
title: t('accountSwitcher.title') || 'Switch account',
|
|
34
|
-
onBack: goBack,
|
|
35
|
-
onClose: onClose,
|
|
36
|
-
showBackButton: !!goBack,
|
|
37
|
-
showCloseButton: !!onClose,
|
|
38
|
-
elevation: "subtle"
|
|
39
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AccountSwitcher.AccountSwitcherView, {
|
|
40
|
-
onClose: close,
|
|
41
|
-
onAddAccount: () => navigate?.('OxyAuth'),
|
|
42
|
-
onNavigateManage: () => navigate?.('ManageAccount'),
|
|
43
|
-
onCreateAccount: () => navigate?.('CreateAccount'),
|
|
44
|
-
onOpenAccountSettings: accountId => navigate?.('AccountSettings', {
|
|
45
|
-
accountId
|
|
46
|
-
})
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
var _default = exports.default = AccountSwitcherScreen;
|
|
51
|
-
//# sourceMappingURL=AccountSwitcherScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_Header","_interopRequireDefault","_AccountSwitcher","_useI18n","_jsxRuntime","e","__esModule","default","AccountSwitcherScreen","onClose","goBack","navigate","t","useI18n","close","useCallback","jsxs","View","className","children","jsx","title","onBack","showBackButton","showCloseButton","elevation","AccountSwitcherView","onAddAccount","onNavigateManage","onCreateAccount","onOpenAccountSettings","accountId","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/screens/AccountSwitcherScreen.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3C;AACA;AACA;AACA;AACA;AACA,GACA,MAAMG,qBAAgD,GAAGA,CAAC;EAAEC,OAAO;EAAEC,MAAM;EAAEC;AAAS,CAAC,KAAK;EAC1F,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,gBAAO,EAAC,CAAC;EAEvB,MAAMC,KAAK,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC9B,CAACN,OAAO,IAAIC,MAAM,IAAI,CAAC;EACzB,CAAC,EAAE,CAACD,OAAO,EAAEC,MAAM,CAAC,CAAC;EAErB,oBACE,IAAAN,WAAA,CAAAY,IAAA,EAACjB,YAAA,CAAAkB,IAAI;IAACC,SAAS,EAAC,cAAc;IAAAC,QAAA,gBAC5B,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,OAAA,CAAAO,OAAM;MACLc,KAAK,EAAET,CAAC,CAAC,uBAAuB,CAAC,IAAI,gBAAiB;MACtDU,MAAM,EAAEZ,MAAO;MACfD,OAAO,EAAEA,OAAQ;MACjBc,cAAc,EAAE,CAAC,CAACb,MAAO;MACzBc,eAAe,EAAE,CAAC,CAACf,OAAQ;MAC3BgB,SAAS,EAAC;IAAQ,CACnB,CAAC,eACF,IAAArB,WAAA,CAAAgB,GAAA,EAAClB,gBAAA,CAAAwB,mBAAmB;MAClBjB,OAAO,EAAEK,KAAM;MACfa,YAAY,EAAEA,CAAA,KAAMhB,QAAQ,GAAG,SAAS,CAAE;MAC1CiB,gBAAgB,EAAEA,CAAA,KAAMjB,QAAQ,GAAG,eAAe,CAAE;MACpDkB,eAAe,EAAEA,CAAA,KAAMlB,QAAQ,GAAG,eAAe,CAAE;MACnDmB,qBAAqB,EAAGC,SAAS,IAAKpB,QAAQ,GAAG,iBAAiB,EAAE;QAAEoB;MAAU,CAAC;IAAE,CACpF,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAEaC,qBAAqB","ignoreList":[]}
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _theme = require("@oxyhq/bloom/theme");
|
|
10
|
-
var _button = require("@oxyhq/bloom/button");
|
|
11
|
-
var _loading = require("@oxyhq/bloom/loading");
|
|
12
|
-
var _typography = require("@oxyhq/bloom/typography");
|
|
13
|
-
var _iconCircle = require("@oxyhq/bloom/icon-circle");
|
|
14
|
-
var Icons = _interopRequireWildcard(require("@oxyhq/bloom/icons"));
|
|
15
|
-
var _bloom = require("@oxyhq/bloom");
|
|
16
|
-
var _core = require("@oxyhq/core");
|
|
17
|
-
var _OxyContext = require("../context/OxyContext.js");
|
|
18
|
-
var _OxyLogo = _interopRequireDefault(require("../components/OxyLogo.js"));
|
|
19
|
-
var _AnotherDeviceQR = _interopRequireDefault(require("../components/AnotherDeviceQR.js"));
|
|
20
|
-
var _LoadingState = _interopRequireDefault(require("../components/LoadingState.js"));
|
|
21
|
-
var _SignInAccountChooser = _interopRequireDefault(require("../components/SignInAccountChooser.js"));
|
|
22
|
-
var _useSwitchableAccounts = require("../hooks/useSwitchableAccounts.js");
|
|
23
|
-
var _useI18n = require("../hooks/useI18n.js");
|
|
24
|
-
var _useOxyAuthSession = require("../hooks/useOxyAuthSession.js");
|
|
25
|
-
var _usePasswordSignIn = require("../hooks/usePasswordSignIn.js");
|
|
26
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
28
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
29
|
-
/**
|
|
30
|
-
* OxyAuthScreen — Sign in with Oxy (native bottom-sheet container).
|
|
31
|
-
*
|
|
32
|
-
* Two phases, Google-style:
|
|
33
|
-
* 1. Account chooser (FRONT screen, shown when the device/user already has
|
|
34
|
-
* accounts): pick an account to continue as — one tap switches through the
|
|
35
|
-
* SAME `switchToAccount` path the account switcher uses — or "Use another
|
|
36
|
-
* account" to reveal the sign-in options.
|
|
37
|
-
* 2. Sign-in options: the first-party password flow (identifier → password →
|
|
38
|
-
* optional 2FA, `usePasswordSignIn`) as the PRIMARY action, with the
|
|
39
|
-
* cross-app device flow (same-device deep-link + "sign in on another device"
|
|
40
|
-
* QR) as a SECONDARY option below an "or" divider.
|
|
41
|
-
*
|
|
42
|
-
* The device-flow machinery lives in the shared `useOxyAuthSession` hook (the
|
|
43
|
-
* web `SignInModal` consumes it too). This screen should NOT be used within the
|
|
44
|
-
* Oxy Accounts app itself.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
const OxyAuthScreen = ({
|
|
48
|
-
goBack,
|
|
49
|
-
onAuthenticated
|
|
50
|
-
}) => {
|
|
51
|
-
const bloomTheme = (0, _theme.useTheme)();
|
|
52
|
-
const {
|
|
53
|
-
oxyServices,
|
|
54
|
-
handleWebSession,
|
|
55
|
-
clientId,
|
|
56
|
-
switchToAccount
|
|
57
|
-
} = (0, _OxyContext.useOxy)();
|
|
58
|
-
const {
|
|
59
|
-
t
|
|
60
|
-
} = (0, _useI18n.useI18n)();
|
|
61
|
-
const {
|
|
62
|
-
accounts
|
|
63
|
-
} = (0, _useSwitchableAccounts.useSwitchableAccounts)();
|
|
64
|
-
const [useAnother, setUseAnother] = (0, _react.useState)(false);
|
|
65
|
-
const [switchingId, setSwitchingId] = (0, _react.useState)(null);
|
|
66
|
-
const showChooser = !useAnother && accounts.length > 0;
|
|
67
|
-
const {
|
|
68
|
-
qrData,
|
|
69
|
-
qrPayload,
|
|
70
|
-
isLoading,
|
|
71
|
-
error,
|
|
72
|
-
isWaiting,
|
|
73
|
-
openSameDeviceApproval,
|
|
74
|
-
retry
|
|
75
|
-
} = (0, _useOxyAuthSession.useOxyAuthSession)(oxyServices, clientId, handleWebSession, {
|
|
76
|
-
onSignedIn: onAuthenticated
|
|
77
|
-
});
|
|
78
|
-
const pw = (0, _usePasswordSignIn.usePasswordSignIn)({
|
|
79
|
-
onSignedIn: onAuthenticated
|
|
80
|
-
});
|
|
81
|
-
const handleSelectAccount = (0, _react.useCallback)(async account => {
|
|
82
|
-
if (account.isCurrent) {
|
|
83
|
-
onAuthenticated?.();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (switchingId) return;
|
|
87
|
-
setSwitchingId(account.accountId);
|
|
88
|
-
try {
|
|
89
|
-
await switchToAccount(account.accountId);
|
|
90
|
-
onAuthenticated?.();
|
|
91
|
-
} catch (switchError) {
|
|
92
|
-
if ((0, _core.isDev)()) {
|
|
93
|
-
_core.logger.warn('OxyAuthScreen: switch account failed', {
|
|
94
|
-
component: 'OxyAuthScreen'
|
|
95
|
-
}, switchError);
|
|
96
|
-
}
|
|
97
|
-
_bloom.toast.error(t('accountSwitcher.toasts.switchFailed') || 'Failed to switch account');
|
|
98
|
-
} finally {
|
|
99
|
-
setSwitchingId(null);
|
|
100
|
-
}
|
|
101
|
-
}, [switchingId, switchToAccount, onAuthenticated, t]);
|
|
102
|
-
const inputStyle = {
|
|
103
|
-
width: '100%',
|
|
104
|
-
borderWidth: 1,
|
|
105
|
-
borderRadius: 12,
|
|
106
|
-
paddingHorizontal: 16,
|
|
107
|
-
paddingVertical: 13,
|
|
108
|
-
fontSize: 15,
|
|
109
|
-
marginBottom: 12,
|
|
110
|
-
borderColor: bloomTheme.colors.border,
|
|
111
|
-
color: bloomTheme.colors.text,
|
|
112
|
-
backgroundColor: bloomTheme.colors.backgroundSecondary
|
|
113
|
-
};
|
|
114
|
-
const title = showChooser ? t('signin.chooser.title') : 'Sign in to Oxy';
|
|
115
|
-
const subtitle = showChooser ? t('signin.chooser.subtitle') : 'Continue with your Oxy identity to sign in securely';
|
|
116
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
117
|
-
className: "flex-1 items-center justify-center bg-bg px-screen-margin",
|
|
118
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
119
|
-
className: "items-center mb-space-24 gap-space-12",
|
|
120
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
|
|
121
|
-
variant: "icon",
|
|
122
|
-
size: 52
|
|
123
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.H4, {
|
|
124
|
-
className: "text-headerBold font-headerBold text-text text-center",
|
|
125
|
-
children: title
|
|
126
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
127
|
-
className: "font-sans text-body text-text-secondary text-center",
|
|
128
|
-
children: subtitle
|
|
129
|
-
})]
|
|
130
|
-
}), showChooser ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SignInAccountChooser.default, {
|
|
131
|
-
accounts: accounts,
|
|
132
|
-
onSelectAccount: handleSelectAccount,
|
|
133
|
-
onUseAnother: () => setUseAnother(true),
|
|
134
|
-
pendingAccountId: switchingId,
|
|
135
|
-
disabled: switchingId !== null
|
|
136
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
137
|
-
children: [accounts.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
138
|
-
variant: "text",
|
|
139
|
-
size: "small",
|
|
140
|
-
className: "self-start mb-space-8",
|
|
141
|
-
onPress: () => setUseAnother(false),
|
|
142
|
-
accessibilityLabel: "Choose an account",
|
|
143
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icons.ArrowLeft_Stroke2_Corner0_Rounded, {
|
|
144
|
-
size: "sm",
|
|
145
|
-
style: {
|
|
146
|
-
color: bloomTheme.colors.textSecondary
|
|
147
|
-
}
|
|
148
|
-
}),
|
|
149
|
-
children: "Choose an account"
|
|
150
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
151
|
-
className: "w-full",
|
|
152
|
-
children: [pw.step === 'identifier' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
153
|
-
style: inputStyle,
|
|
154
|
-
value: pw.identifier,
|
|
155
|
-
onChangeText: pw.setIdentifier,
|
|
156
|
-
onSubmitEditing: pw.submitIdentifier,
|
|
157
|
-
placeholder: "Username or email",
|
|
158
|
-
placeholderTextColor: bloomTheme.colors.textSecondary,
|
|
159
|
-
autoCapitalize: "none",
|
|
160
|
-
autoCorrect: false,
|
|
161
|
-
keyboardType: "email-address",
|
|
162
|
-
returnKeyType: "next",
|
|
163
|
-
accessibilityLabel: "Username or email"
|
|
164
|
-
}), pw.step === 'password' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
165
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
166
|
-
className: "font-sans text-body text-text-secondary text-center mb-space-12",
|
|
167
|
-
children: pw.identifier
|
|
168
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
169
|
-
style: inputStyle,
|
|
170
|
-
value: pw.password,
|
|
171
|
-
onChangeText: pw.setPassword,
|
|
172
|
-
onSubmitEditing: pw.submitPassword,
|
|
173
|
-
placeholder: "Password",
|
|
174
|
-
placeholderTextColor: bloomTheme.colors.textSecondary,
|
|
175
|
-
secureTextEntry: true,
|
|
176
|
-
autoCapitalize: "none",
|
|
177
|
-
autoCorrect: false,
|
|
178
|
-
returnKeyType: "go",
|
|
179
|
-
accessibilityLabel: "Password"
|
|
180
|
-
})]
|
|
181
|
-
}), pw.step === 'twoFactor' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
182
|
-
style: inputStyle,
|
|
183
|
-
value: pw.code,
|
|
184
|
-
onChangeText: pw.setCode,
|
|
185
|
-
onSubmitEditing: pw.submitTwoFactor,
|
|
186
|
-
placeholder: pw.useBackupCode ? 'Backup code' : '6-digit code',
|
|
187
|
-
placeholderTextColor: bloomTheme.colors.textSecondary,
|
|
188
|
-
autoCapitalize: "none",
|
|
189
|
-
autoCorrect: false,
|
|
190
|
-
keyboardType: pw.useBackupCode ? 'default' : 'number-pad',
|
|
191
|
-
returnKeyType: "go",
|
|
192
|
-
accessibilityLabel: pw.useBackupCode ? 'Backup code' : 'Two-factor code'
|
|
193
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
194
|
-
variant: "primary",
|
|
195
|
-
size: "large",
|
|
196
|
-
fullWidth: true,
|
|
197
|
-
className: "w-full",
|
|
198
|
-
onPress: pw.step === 'identifier' ? pw.submitIdentifier : pw.step === 'password' ? pw.submitPassword : pw.submitTwoFactor,
|
|
199
|
-
loading: pw.isSubmitting,
|
|
200
|
-
disabled: pw.isSubmitting,
|
|
201
|
-
children: pw.step === 'identifier' ? 'Continue' : pw.step === 'password' ? 'Sign in' : 'Verify'
|
|
202
|
-
}), pw.error && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
203
|
-
className: "font-sans text-body text-destructive text-center mt-space-12",
|
|
204
|
-
children: pw.error
|
|
205
|
-
}), pw.step === 'twoFactor' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
206
|
-
variant: "text",
|
|
207
|
-
size: "small",
|
|
208
|
-
className: "mt-space-8",
|
|
209
|
-
onPress: () => pw.setUseBackupCode(!pw.useBackupCode),
|
|
210
|
-
children: pw.useBackupCode ? 'Use authenticator code' : 'Use a backup code'
|
|
211
|
-
}), pw.step !== 'identifier' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
212
|
-
variant: "text",
|
|
213
|
-
size: "small",
|
|
214
|
-
className: "mt-space-8",
|
|
215
|
-
onPress: pw.back,
|
|
216
|
-
accessibilityLabel: "Back",
|
|
217
|
-
children: "Back"
|
|
218
|
-
})]
|
|
219
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
220
|
-
className: "flex-row items-center w-full my-space-16 gap-space-8",
|
|
221
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
222
|
-
className: "flex-1",
|
|
223
|
-
style: {
|
|
224
|
-
height: 1,
|
|
225
|
-
backgroundColor: bloomTheme.colors.border
|
|
226
|
-
}
|
|
227
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
228
|
-
className: "font-sans text-caption text-text-tertiary",
|
|
229
|
-
children: "or"
|
|
230
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
231
|
-
className: "flex-1",
|
|
232
|
-
style: {
|
|
233
|
-
height: 1,
|
|
234
|
-
backgroundColor: bloomTheme.colors.border
|
|
235
|
-
}
|
|
236
|
-
})]
|
|
237
|
-
}), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingState.default, {
|
|
238
|
-
size: "small",
|
|
239
|
-
color: bloomTheme.colors.primary,
|
|
240
|
-
message: "Preparing sign in\u2026"
|
|
241
|
-
}) : error ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
242
|
-
className: "items-center gap-space-16 w-full",
|
|
243
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iconCircle.IconCircle, {
|
|
244
|
-
icon: Icons.Warning_Stroke2_Corner0_Rounded
|
|
245
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
246
|
-
className: "font-sans text-body text-text-secondary text-center",
|
|
247
|
-
children: error
|
|
248
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
249
|
-
variant: "secondary",
|
|
250
|
-
fullWidth: true,
|
|
251
|
-
className: "w-full",
|
|
252
|
-
onPress: retry,
|
|
253
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icons.ArrowRotateClockwise_Stroke2_Corner0_Rounded, {
|
|
254
|
-
size: "sm",
|
|
255
|
-
style: {
|
|
256
|
-
color: bloomTheme.colors.text
|
|
257
|
-
}
|
|
258
|
-
}),
|
|
259
|
-
children: "Try Again"
|
|
260
|
-
})]
|
|
261
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
262
|
-
children: [qrPayload && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
263
|
-
variant: "secondary",
|
|
264
|
-
size: "large",
|
|
265
|
-
fullWidth: true,
|
|
266
|
-
className: "w-full",
|
|
267
|
-
onPress: openSameDeviceApproval,
|
|
268
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
|
|
269
|
-
variant: "icon",
|
|
270
|
-
size: 20,
|
|
271
|
-
fillColor: bloomTheme.colors.text
|
|
272
|
-
}),
|
|
273
|
-
children: "Sign in with the Oxy app"
|
|
274
|
-
}), isWaiting && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
275
|
-
className: "flex-row items-center mt-space-16 gap-space-8",
|
|
276
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_loading.Loading, {
|
|
277
|
-
size: "small"
|
|
278
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
279
|
-
className: "font-sans text-body text-text-secondary",
|
|
280
|
-
children: "Waiting for authorization\u2026"
|
|
281
|
-
})]
|
|
282
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
283
|
-
className: "w-full mt-space-24",
|
|
284
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnotherDeviceQR.default, {
|
|
285
|
-
qrData: qrData,
|
|
286
|
-
qrPayload: qrPayload
|
|
287
|
-
})
|
|
288
|
-
})]
|
|
289
|
-
})]
|
|
290
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
291
|
-
className: "flex-row flex-wrap justify-center items-center mt-space-24",
|
|
292
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
293
|
-
className: "font-sans text-body text-text-secondary",
|
|
294
|
-
children: "Don't have an Oxy account?"
|
|
295
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
296
|
-
variant: "text",
|
|
297
|
-
size: "small",
|
|
298
|
-
onPress: () => _reactNative.Linking.openURL(_useOxyAuthSession.OXY_ACCOUNTS_WEB_URL),
|
|
299
|
-
accessibilityLabel: "Create an Oxy account",
|
|
300
|
-
children: "Create one"
|
|
301
|
-
})]
|
|
302
|
-
}), goBack && /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
303
|
-
variant: "text",
|
|
304
|
-
onPress: goBack,
|
|
305
|
-
className: "mt-space-8",
|
|
306
|
-
accessibilityLabel: "Cancel",
|
|
307
|
-
children: "Cancel"
|
|
308
|
-
})]
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
var _default = exports.default = OxyAuthScreen;
|
|
312
|
-
//# sourceMappingURL=OxyAuthScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_theme","_button","_loading","_typography","_iconCircle","Icons","_interopRequireWildcard","_bloom","_core","_OxyContext","_OxyLogo","_interopRequireDefault","_AnotherDeviceQR","_LoadingState","_SignInAccountChooser","_useSwitchableAccounts","_useI18n","_useOxyAuthSession","_usePasswordSignIn","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OxyAuthScreen","goBack","onAuthenticated","bloomTheme","useTheme","oxyServices","handleWebSession","clientId","switchToAccount","useOxy","useI18n","accounts","useSwitchableAccounts","useAnother","setUseAnother","useState","switchingId","setSwitchingId","showChooser","length","qrData","qrPayload","isLoading","error","isWaiting","openSameDeviceApproval","retry","useOxyAuthSession","onSignedIn","pw","usePasswordSignIn","handleSelectAccount","useCallback","account","isCurrent","accountId","switchError","isDev","loggerUtil","warn","component","toast","inputStyle","width","borderWidth","borderRadius","paddingHorizontal","paddingVertical","fontSize","marginBottom","borderColor","colors","border","color","text","backgroundColor","backgroundSecondary","title","subtitle","jsxs","View","className","children","jsx","variant","size","H4","Text","onSelectAccount","onUseAnother","pendingAccountId","disabled","Fragment","Button","onPress","accessibilityLabel","icon","ArrowLeft_Stroke2_Corner0_Rounded","style","textSecondary","step","TextInput","value","identifier","onChangeText","setIdentifier","onSubmitEditing","submitIdentifier","placeholder","placeholderTextColor","autoCapitalize","autoCorrect","keyboardType","returnKeyType","password","setPassword","submitPassword","secureTextEntry","code","setCode","submitTwoFactor","useBackupCode","fullWidth","loading","isSubmitting","setUseBackupCode","back","height","primary","message","IconCircle","Warning_Stroke2_Corner0_Rounded","ArrowRotateClockwise_Stroke2_Corner0_Rounded","fillColor","Loading","Linking","openURL","OXY_ACCOUNTS_WEB_URL","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/screens/OxyAuthScreen.tsx"],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAC,uBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAC,sBAAA,CAAAb,OAAA;AACA,IAAAc,gBAAA,GAA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