Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(console): replace ts with js for JWT customizer #5760

Merged
merged 1 commit into from
Apr 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,17 @@ function MonacoCodeEditor({
}

if (activeModel.language === 'typescript') {
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
noSemanticValidation: false,
noSyntaxValidation: false,
});

// Set the typescript compiler options
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
allowNonTsExtensions: true,
strictNullChecks: true,
allowJs: true,
checkJs: true,
});
}
}, [activeModel, monaco, environmentVariablesDefinition]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ export const defaultAccessTokenJwtCustomizerCode = `/**
* This function is called during the access token generation process to get custom claims for the JWT token.
* Limit custom claims to under 50KB.
*
* @param {Payload} payload - The input payload of the function.
* @param {Object} payload - The input payload of the function.
* @param {${JwtCustomizerTypeDefinitionKey.AccessTokenPayload}} payload.token -The JWT token.
* @param {Context} payload.context - Logto internal data that can be used to pass additional information
* @param {${JwtCustomizerTypeDefinitionKey.JwtCustomizerUserContext}} payload.context.user - The user info associated with the token.
* @param {${JwtCustomizerTypeDefinitionKey.EnvironmentVariables}} [payload.environmentVariables] - The environment variables.
*
* @returns The custom claims.
*/

const getCustomJwtClaims = async ({ token, context, environmentVariables }) => {
return {};
}`;
Expand All @@ -64,19 +62,18 @@ export const defaultClientCredentialsJwtCustomizerCode = `/**
* This function is called during the access token generation process to get custom claims for the JWT token.
* Limit custom claims to under 50KB.
*
* @param {Payload} payload - The input payload of the function.
* @param {Object} payload - The input payload of the function.
* @param {${JwtCustomizerTypeDefinitionKey.ClientCredentialsPayload}} payload.token -The JWT token.
* @param {${JwtCustomizerTypeDefinitionKey.EnvironmentVariables}} [payload.environmentVariables] - The environment variables.
*
* @returns The custom claims.
*/

const getCustomJwtClaims = async ({ token, environmentVariables }) => {
return {};
}`;

export const accessTokenJwtCustomizerModel: ModelSettings = {
name: 'user-jwt.ts',
name: 'user-jwt.js',
title: 'User access token',
language: 'typescript',
defaultValue: defaultAccessTokenJwtCustomizerCode,
Expand All @@ -93,7 +90,7 @@ export const accessTokenJwtCustomizerModel: ModelSettings = {
};

export const clientCredentialsModel: ModelSettings = {
name: 'machine-to-machine-jwt.ts',
name: 'machine-to-machine-jwt.js',
title: 'Machine-to-machine token',
language: 'typescript',
defaultValue: defaultClientCredentialsJwtCustomizerCode,
Expand Down
Loading