@intra-mart/smartlime 1.0.0-dev.20230227 → 1.0.0-dev.20230228

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.
@@ -7,5 +7,6 @@ export interface IMWebViewProps extends Omit<WebViewProps, 'onShouldStartLoadWit
7
7
  source: WebViewSourceUri;
8
8
  onSessionCreationError?: OnSessionCreationError;
9
9
  indicator?: JSX.Element | null;
10
+ forceLogin?: boolean;
10
11
  }
11
12
  export declare const IMWebView: React.ForwardRefExoticComponent<IMWebViewProps & React.RefAttributes<WebView<{}>>>;
@@ -13,7 +13,7 @@ const useCheckSessionUrl = (baseUrl) => {
13
13
  const useGetSessionUrl = (baseUrl) => {
14
14
  return join(baseUrl, '/api/bearer/smacolow/session');
15
15
  };
16
- const usLogoutUrl = (baseUrl) => {
16
+ const useLogoutUrl = (baseUrl) => {
17
17
  return join(baseUrl, '/logout');
18
18
  };
19
19
  const useLogin = (props, webviewRef) => {
@@ -22,8 +22,9 @@ const useLogin = (props, webviewRef) => {
22
22
  const targetUrl = props.source.uri;
23
23
  const checkSessionUrl = useCheckSessionUrl(baseUrl);
24
24
  const getSessionUrl = useGetSessionUrl(baseUrl);
25
- const logoutUrl = usLogoutUrl(baseUrl);
26
- const currentUrlRef = useRef(checkSessionUrl);
25
+ const logoutUrl = useLogoutUrl(baseUrl);
26
+ const initialUrlRef = useRef(props.forceLogin ? logoutUrl : checkSessionUrl);
27
+ const currentUrlRef = useRef(initialUrlRef.current);
27
28
  const isCheckSessionErrorRef = useRef(false);
28
29
  const [isFailedLogin, setIsFailedLogin] = useState(false);
29
30
  const [isLogin, setIsLogin] = useState(false);
@@ -123,7 +124,7 @@ const useLogin = (props, webviewRef) => {
123
124
  };
124
125
  const autoLoginProps = {
125
126
  source: {
126
- uri: checkSessionUrl,
127
+ uri: initialUrlRef.current,
127
128
  },
128
129
  sharedCookiesEnabled: false,
129
130
  onLoad,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intra-mart/smartlime",
3
3
  "description": "expoで使用できるintra mart accelplatform SDK",
4
- "version": "1.0.0-dev.20230227",
4
+ "version": "1.0.0-dev.20230228",
5
5
  "keywords": [
6
6
  "intra-mart",
7
7
  "AccelPlatform",