Skip to content

Commit bf7d44b

Browse files
authored
Merge branch 'logto-io:master' into master
2 parents dd40be7 + cfb1ace commit bf7d44b

80 files changed

Lines changed: 922 additions & 256 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/lovely-eels-end.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@logto/core": patch
3+
---
4+
5+
fix email/phone template selection during sign up
6+
7+
Previously, the send code API (Experience API) always switched to the `TemplateType.BindMfa` email template as soon as an interaction already had an identified user. During multi-step sign-up flows (for example, username + email), the interaction can already identify the user before the email step finishes, so legitimate sign-up verifications were mistakenly treated as MFA binding and used the wrong template.
8+
9+
The fix checks if the email/phone identifier is part of the sign-up identifiers. If it is, then we are still in the sign-up flow and should use the appropriate sign-up email/phone template. Only when the email/phone is not part of the sign-up identifiers (meaning the sign-up flow is complete) and the interaction has an identified user, do we switch to the `BindMfa` template.

.changeset/pretty-snails-deny.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@logto/integration-tests": minor
3+
"@logto/experience": minor
4+
"@logto/core": minor
5+
---
6+
7+
support cross-app authentication callbacks within the same browser session
8+
9+
When multiple applications are initiating authentication requests within the same browser session,
10+
authentication callbacks may interfere with each other due to the shared `_interaction` cookie.
11+
12+
To resolve this, we now change the cookie from a plain UID string to a structured mapping object
13+
`{ [app_id]: interaction_uid }`, and maintain the `app_id` in either the URL search parameters or HTTP
14+
headers for all authentication-related requests and redirects. This ensures that each application can
15+
correctly identify its own authentication context without interference from others.
16+
17+
The fallback mechanism is also implemented to ensure backward compatibility.

commitlint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const config: UserConfig = {
77
extends: ['@commitlint/config-conventional'],
88
rules: {
99
'type-enum': [2, 'always', [...conventional.rules['type-enum'][2], 'api', 'release']],
10-
'scope-enum': [2, 'always', ['connector', 'console', 'core', 'demo-app', 'test', 'phrases', 'schemas', 'shared', 'experience', 'experience-legacy', 'deps', 'deps-dev', 'cli', 'toolkit', 'cloud', 'app-insights', 'elements', 'translate', 'tunnel', 'account-elements']],
10+
'scope-enum': [2, 'always', ['connector', 'console', 'core', 'demo-app', 'test', 'phrases', 'schemas', 'shared', 'experience', 'experience-legacy', 'deps', 'deps-dev', 'cli', 'toolkit', 'cloud', 'app-insights', 'elements', 'translate', 'tunnel', 'account-elements', 'account-center']],
1111
// Slightly increase the tolerance to allow the appending PR number
1212
...(isCi && { 'header-max-length': [2, 'always', 110] }),
1313
'body-max-line-length': [2, 'always', 110],

packages/account-center/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>Account Center</title>
7+
</head>
8+
9+
<body>
10+
<noscript>You need to enable JavaScript to run this app.</noscript>
11+
<div id="app"></div>
12+
<script type="module" src="src/index.tsx"></script>
13+
</body>
14+
15+
</html>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "@logto/account-center",
3+
"version": "0.1.0",
4+
"description": "Logto account center app.",
5+
"author": "Silverhand Inc. <contact@silverhand.io>",
6+
"license": "MPL-2.0",
7+
"private": true,
8+
"type": "module",
9+
"files": [
10+
"dist"
11+
],
12+
"scripts": {
13+
"precommit": "lint-staged",
14+
"start": "vite",
15+
"dev": "vite",
16+
"check": "tsc --noEmit",
17+
"build": "vite build",
18+
"lint": "eslint --ext .ts --ext .tsx src",
19+
"lint:report": "pnpm lint --format json --output-file report.json"
20+
},
21+
"devDependencies": {
22+
"@silverhand/eslint-config": "6.0.1",
23+
"@silverhand/eslint-config-react": "6.0.2",
24+
"@silverhand/ts-config": "6.0.0",
25+
"@silverhand/ts-config-react": "6.0.0",
26+
"@types/react": "^18.3.3",
27+
"@types/react-dom": "^18.3.0",
28+
"@vitejs/plugin-react": "^4.3.1",
29+
"eslint": "^8.56.0",
30+
"lint-staged": "^15.0.0",
31+
"prettier": "^3.5.3",
32+
"react": "^18.3.1",
33+
"react-dom": "^18.3.1",
34+
"typescript": "^5.5.3",
35+
"vite": "^6.3.6",
36+
"vite-plugin-compression": "^0.5.1"
37+
},
38+
"engines": {
39+
"node": "^22.14.0"
40+
},
41+
"eslintConfig": {
42+
"extends": "@silverhand/react"
43+
},
44+
"prettier": "@silverhand/eslint-config/.prettierrc"
45+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const App = () => {
2+
return (
3+
<main>
4+
<h1>Account Center</h1>
5+
</main>
6+
);
7+
};
8+
9+
export default App;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createRoot } from 'react-dom/client';
2+
3+
import App from './App';
4+
5+
const app = document.querySelector('#app');
6+
const root = app && createRoot(app);
7+
root?.render(<App />);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "@silverhand/ts-config-react/tsconfig.base",
3+
"compilerOptions": {
4+
"outDir": "build",
5+
"baseUrl": ".",
6+
"paths": {
7+
"@/*": [
8+
"src/*"
9+
]
10+
}
11+
}
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.base",
3+
"include": [
4+
"src",
5+
"*.config.ts"
6+
]
7+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import react from '@vitejs/plugin-react';
2+
import { mergeConfig, defineConfig, type UserConfig } from 'vite';
3+
import viteCompression from 'vite-plugin-compression';
4+
5+
import { defaultConfig } from '../../vite.shared.config';
6+
7+
const buildConfig = (mode: string): UserConfig => ({
8+
base: '/account-center',
9+
server: {
10+
port: 5004,
11+
hmr: {
12+
port: 6004,
13+
},
14+
},
15+
plugins: [
16+
react(),
17+
viteCompression({ disable: mode === 'development' }),
18+
viteCompression({ disable: mode === 'development', algorithm: 'brotliCompress' }),
19+
],
20+
});
21+
22+
export default defineConfig(({ mode }) => mergeConfig(defaultConfig, buildConfig(mode)));

0 commit comments

Comments
 (0)