Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15,333 changes: 7,121 additions & 8,212 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"eslint-plugin-simple-import-sort": "10.0.0",
"lerna": "^8.1.8",
"node-fetch": "^3.3.2",
"pm2": "^5.3.0",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"ts-loader": "^9.5.1",
Expand Down
5 changes: 1 addition & 4 deletions packages/connect-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
},
"dependencies": {
"@corbado/web-core": "^3.0.1",
"date-fns": "^3.6.0",
"i18next": "23.5.1",
"i18next-browser-languagedetector": "7.1.0",
"react-i18next": "13.2.2"
"date-fns": "^3.6.0"
},
"devDependencies": {
"@corbado/types": "^3.0.1",
Expand Down
3 changes: 0 additions & 3 deletions packages/connect-react/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ module.exports = merge(common, {
externals: {
'@corbado/web-core': '@corbado/web-core',
react: 'react',
i18next: 'i18next',
'i18next-browser-languagedetector': 'i18next-browser-languagedetector',
'react-i18next': 'react-i18next',
},
});
1 change: 0 additions & 1 deletion packages/react/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- Fix a bug where passkey-append aborts in rare cases when users create a passkey right after signup.


## 3.0.0

### Major changes
Expand Down
4 changes: 2 additions & 2 deletions packages/web-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"url": "https://github.com/corbado/javascript/issues"
},
"dependencies": {
"@corbado/webauthn-json": "^2.1.2",
"@corbado/webauthn-json": "^2.2.0",
"@fingerprintjs/fingerprintjs": "^3.4.2",
"axios": "^1.7.4",
"axios": "^1.8.4",
"detectincognitojs": "^1.3.7",
"loglevel": "^1.8.1",
"rxjs": "^7.8.1",
Expand Down
5 changes: 3 additions & 2 deletions playground/connect-next/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import { cookies } from 'next/headers';

export async function getAppendToken() {
const displayName = cookies().get('displayName');
const cookieStore = await cookies();
const displayName = cookieStore.get('displayName');
if (!displayName) {
return null;
}

const identifier = cookies().get('identifier');
const identifier = cookieStore.get('identifier');
if (!identifier) {
return null;
}
Expand Down
5 changes: 3 additions & 2 deletions playground/connect-next/app/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { cookies } from 'next/headers';
import Home from '@/app/home/client';

export default function Page() {
const maybeSecretCode = cookies().get('secretCode');
export default async function Page() {
const cookieStore = await cookies();
const maybeSecretCode = cookieStore.get('secretCode');

return <Home maybeSecretCode={maybeSecretCode?.value} />;
}
15 changes: 9 additions & 6 deletions playground/connect-next/app/login/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export async function postPasskeyLogin(session: string) {

const email = response.UserAttributes?.find(attr => attr.Name === 'email')?.Value;
if (email) {
cookies().set('displayName', email);
cookies().set('identifier', username);
const cookieStore = await cookies();
cookieStore.set('displayName', email);
cookieStore.set('identifier', username);
}

return;
Expand All @@ -64,7 +65,8 @@ export async function postPasskeyLoginNew(signedPasskeyData: string, clientState
await postPasskeyLogin(out.session);

// update client side state
cookies().set({ name: 'cbo_client_state', value: clientState, httpOnly: true });
const cookieStore = await cookies();
cookieStore.set({ name: 'cbo_client_state', value: clientState, httpOnly: true });
}

function createSecretHash(username: string, clientId: string, clientSecret: string) {
Expand All @@ -80,7 +82,8 @@ export async function startConventionalLogin(email: string, password: string) {
throw new Error('Email and password are required.');
}

cookies().set('displayName', email);
const cookieStore = await cookies();
cookieStore.set('displayName', email);

const client = new CognitoIdentityProviderClient({
region: process.env.AWS_REGION!,
Expand Down Expand Up @@ -113,14 +116,14 @@ export async function startConventionalLogin(email: string, password: string) {
const decoded = await verifyToken(response.AuthenticationResult.AccessToken);
const username = decoded.username;
if (email) {
cookies().set('identifier', username);
cookieStore.set('identifier', username);
}

return { success: true };
}

if (response.Session && response.ChallengeName === 'SOFTWARE_TOKEN_MFA') {
cookies().set('mfa_session', response.Session);
cookieStore.set('mfa_session', response.Session);

return { success: true, screen: 'MFA_SOFTWARE_TOKEN' };
}
Expand Down
5 changes: 3 additions & 2 deletions playground/connect-next/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ export type Props = {
clientState: string | undefined;
};

export default function LoginPage() {
const clientState = cookies().get('cbo_client_state');
export default async function LoginPage() {
const cookieStore = await cookies();
const clientState = cookieStore.get('cbo_client_state');
console.log('clientState', clientState);

return <LoginComponent clientState={clientState?.value} />;
Expand Down
8 changes: 5 additions & 3 deletions playground/connect-next/app/mfa-software-token/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ function createSecretHash(username: string, clientId: string, clientSecret: stri

export async function startMFASoftwareToken(totp: string) {
try {
const session = cookies().get('mfa_session');
const displayName = cookies().get('displayName');
const cookieStore = await cookies();
const session = cookieStore.get('mfa_session');
const displayName = cookieStore.get('displayName');

if (!totp || !session || !displayName) {
throw new Error('Missing required fields.');
Expand Down Expand Up @@ -75,7 +76,8 @@ export async function startMFASoftwareToken(totp: string) {
}

export async function generateTOTP() {
const secretCode = cookies().get('secretCode');
const cookieStore = await cookies();
const secretCode = cookieStore.get('secretCode');
if (!secretCode) {
return {
success: false,
Expand Down
3 changes: 2 additions & 1 deletion playground/connect-next/app/passkey-list/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { cookies } from 'next/headers';
import { ConnectTokenType } from '@corbado/types';

export async function getCorbadoToken(tokenType: ConnectTokenType) {
const identifier = cookies().get('identifier');
const cookieStore = await cookies();
const identifier = cookieStore.get('identifier');
if (!identifier) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions playground/connect-next/app/post-login/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import { cookies } from 'next/headers';

export async function postPasskeyAppend(_: string, clientState: string) {
// update client side state
cookies().set({ name: 'cbo_client_state', value: clientState, httpOnly: true });
const cookieStore = await cookies();
cookieStore.set({ name: 'cbo_client_state', value: clientState, httpOnly: true });
}
7 changes: 4 additions & 3 deletions playground/connect-next/app/signup/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ export const createAccount = async (email: string, phone: string, password: stri
// of course this is not secure, but it's just a demo ;)

const randomUsername = generateRandomString(10);
const cookieStore = await cookies();

cookies().set('displayName', email);
cookies().set('identifier', randomUsername);
cookieStore.set('displayName', email);
cookieStore.set('identifier', randomUsername);

// create client that loads profile from ~/.aws/credentials or environment variables
const client = new CognitoIdentityProviderClient({
Expand Down Expand Up @@ -91,7 +92,7 @@ export const createAccount = async (email: string, phone: string, password: stri
const associateSoftwareTokenRes = await client.send(associateSoftwareTokenCommand);
console.log('associateSoftwareTokenRes', associateSoftwareTokenRes);

cookies().set('secretCode', associateSoftwareTokenRes.SecretCode!);
cookieStore.set('secretCode', associateSoftwareTokenRes.SecretCode!);

const { otp } = TOTP.generate(associateSoftwareTokenRes.SecretCode!);
console.log('otp', otp);
Expand Down
2 changes: 1 addition & 1 deletion playground/connect-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"crypto-js": "^4.2.0",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"next": "14.2.4",
"next": "15.2.4",
"react": "^18",
"react-dom": "^18",
"totp-generator": "^1.0.0"
Expand Down
3 changes: 2 additions & 1 deletion playground/connect-next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
],
"paths": {
"@/*": ["./*"]
}
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
Expand Down
70 changes: 0 additions & 70 deletions scripts/e2eTests.ts

This file was deleted.

Loading