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: signInOptions context type #1094

Closed
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Fixes

- [#1071](https://github.com/okta/okta-auth-js/pull/1071) TypeScript: Adds fields for `Input` type in NextStep object
- [#1094](https://github.com/okta/okta-auth-js/pull/1094) TypeScript: Fixes `SigninOptions.context` type

## 6.0.0

Expand Down
4 changes: 3 additions & 1 deletion lib/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ export interface SigninOptions extends
AuthenticationOptions {
// Only used in Authn V1
relayState?: string;
context?: string;
context?: {
deviceToken?: string;
};
sendFingerprint?: boolean;
}

Expand Down
5 changes: 4 additions & 1 deletion test/types/auth.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const authorizeOptions2: TokenParams = {
expectType<AuthTransaction>(await authClient.signInWithCredentials({
username: 'some-username',
password: 'some-password',
sendFingerprint: true
sendFingerprint: true,
context: {
deviceToken: 'device-1'
}
}));
expectType<void>(await authClient.signInWithRedirect());
expectType<void>(await authClient.signInWithRedirect({
Expand Down