Skip to content

Commit

Permalink
fix(client): fix superstruct validation rule
Browse files Browse the repository at this point in the history
replace object declaration using type
structs throw errors if they encounter extra properties on an object
  • Loading branch information
simeng-li committed Nov 9, 2021
1 parent 0244596 commit b93b9a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/discover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as s from 'superstruct';
import { requestWithFetch } from './api';
import { LogtoError } from './errors';

const OIDCConfigurationSchema = s.object({
const OIDCConfigurationSchema = s.type({
authorization_endpoint: s.string(),
jwks_uri: s.string(),
token_endpoint: s.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/grant-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as s from 'superstruct';
import { requestWithFetch } from './api';
import { LogtoError } from './errors';

const TokenSetParametersSchema = s.object({
const TokenSetParametersSchema = s.type({
access_token: s.string(),
expires_in: s.number(),
id_token: s.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const fullfillBase64 = (input: string) => {
return input;
};

const IDTokenSchema = s.object({
const IDTokenSchema = s.type({
iss: s.string(),
sub: s.string(),
aud: s.string(),
Expand Down

0 comments on commit b93b9a7

Please sign in to comment.