@criipto/verify-react 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { OAuth2Error, PKCEPublicPart, Prompt } from '@criipto/auth-js';
2
+ import { PKCEPublicPart, Prompt } from '@criipto/auth-js';
3
+ import { Action } from './context';
3
4
  export interface CriiptoVerifyProviderOptions {
4
5
  domain: string;
5
6
  clientID: string;
@@ -8,6 +9,11 @@ export interface CriiptoVerifyProviderOptions {
8
9
  pkce?: PKCEPublicPart;
9
10
  state?: string;
10
11
  prompt?: Prompt;
12
+ /**
13
+ * Will ammend the login_hint parameter with `action:{action}` which will adjust texsts in certain flows.
14
+ * Default: 'login'
15
+ */
16
+ action?: Action;
11
17
  /**
12
18
  * Note: In most cases modifying this setting **is not needed**. Defaults will work with almost all React SPA cases.
13
19
  * By default @criipto/verify-react will do PKCE on your behalf and return a jwt token.
@@ -16,10 +22,5 @@ export interface CriiptoVerifyProviderOptions {
16
22
  response?: 'token' | 'code';
17
23
  completionStrategy?: 'client' | 'openidprovider';
18
24
  }
19
- export declare type Result = {
20
- id_token: string;
21
- } | {
22
- code: string;
23
- } | OAuth2Error;
24
25
  declare const CriiptoVerifyProvider: (props: CriiptoVerifyProviderOptions) => JSX.Element;
25
26
  export default CriiptoVerifyProvider;
@@ -1,3 +1,3 @@
1
1
  export default function useCriiptoVerify(): {
2
- result: import("./provider").Result | null;
2
+ result: import("./context").Result | null;
3
3
  };
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import { Action } from "./context";
1
2
  export declare const DKMITID_PREFIX = "urn:grn:authn:dk:mitid";
2
3
  export declare function lowestMitIDValue(input: string[]): string | null;
3
4
  export declare type Language = 'en' | 'da' | 'sv' | 'nb';
5
+ export declare function stringifyAction(language: Language, action: Action): string;
4
6
  export declare function acrValueToTitle(language: Language, value: string): {
5
7
  title: string;
6
8
  subtitle?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@criipto/verify-react",
3
3
  "private": false,
4
- "version": "0.1.1",
4
+ "version": "0.2.0",
5
5
  "description": "Verify SDK for React Single Page Applications",
6
6
  "main": "dist/criipto-verify-react.cjs.js",
7
7
  "types": "dist/index.d.ts",