Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
# Change Log | ||
## 2.0.0-alpha.3 | ||
### Исправления | ||
- Исправлена ошибка, возникающая при наличии query параметров в redirectUrl | ||
## 2.0.0-alpha.2 | ||
@@ -4,0 +9,0 @@ |
@@ -12,2 +12,3 @@ 'use strict'; | ||
var url = require('../utils/url/url.js'); | ||
var uuid = require('../utils/uuid.js'); | ||
require('../widgets/oauthList/oauthList.js'); | ||
@@ -83,2 +84,3 @@ var types = require('../widgets/oauthList/types.js'); | ||
_define_property(this, "interval", void 0); | ||
_define_property(this, "id", uuid.uuid()); | ||
_define_property(this, "close", function() { | ||
@@ -170,4 +172,4 @@ _this.opener && _this.opener.close(); | ||
stats_info: url.encodeStatsInfo({ | ||
flow_source: (_params4 = params) === null || _params4 === void 0 ? void 0 : _params4.statsFlowSource, | ||
session_id: (_params5 = params) === null || _params5 === void 0 ? void 0 : _params5.uniqueSessionId | ||
flow_source: ((_params4 = params) === null || _params4 === void 0 ? void 0 : _params4.statsFlowSource) || types$2.AuthStatsFlowSource.AUTH, | ||
session_id: ((_params5 = params) === null || _params5 === void 0 ? void 0 : _params5.uniqueSessionId) || _this.id | ||
}) | ||
@@ -174,0 +176,0 @@ }; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
(function(AuthStatsFlowSource) { | ||
AuthStatsFlowSource["AUTH"] = "from_custom_auth"; | ||
AuthStatsFlowSource["BUTTON_ONE_TAP"] = "from_one_tap"; | ||
@@ -7,0 +8,0 @@ AuthStatsFlowSource["FLOATING_ONE_TAP"] = "from_floating_one_tap"; |
'use strict'; | ||
// @ts-ignore-next-line пробрасываем версию из package.json в rollup.config | ||
var VERSION = "2.0.0-alpha.2"; | ||
var VERSION = "2.0.0-alpha.3"; | ||
// @ts-ignore-next-line пробрасываем тип сборки из rollup.config | ||
@@ -6,0 +6,0 @@ var DOMAIN = "vk.com"; |
'use strict'; | ||
var constants = require('../../constants.js'); | ||
var request = require('../../utils/request.js'); | ||
@@ -73,3 +74,4 @@ | ||
var params = { | ||
events: JSON.stringify(_this.stackEvents) | ||
events: JSON.stringify(_this.stackEvents), | ||
sak_version: constants.VERSION | ||
}; | ||
@@ -76,0 +78,0 @@ _this.stackEvents = []; |
@@ -74,6 +74,8 @@ 'use strict'; | ||
var getRedirectWithPayloadUrl = function(payload, config) { | ||
var redirectUrlFromConfig = config.get().redirectUrl; | ||
var containsQuery = redirectUrlFromConfig.includes("?"); | ||
var params = Object.keys(payload).map(function(key) { | ||
return encodeURIComponent(key) + "=" + encodeURIComponent(payload[key]); | ||
}).join("&"); | ||
return "".concat(config.get().redirectUrl, "?").concat(params); | ||
return "".concat(redirectUrlFromConfig).concat(containsQuery ? "&" : "?").concat(params); | ||
}; | ||
@@ -80,0 +82,0 @@ var encodeStatsInfo = function(params) { |
@@ -10,6 +10,7 @@ import './../lib/@vkontakte/vkjs/lib/es6/detections.js'; | ||
import { encodeStatsInfo, getVKIDUrl, getRedirectWithPayloadUrl } from '../utils/url/url.js'; | ||
import { uuid } from '../utils/uuid.js'; | ||
import '../widgets/oauthList/oauthList.js'; | ||
import { ExternalOAuthName } from '../widgets/oauthList/types.js'; | ||
import { OAUTH2_RESPONSE, OAUTH2_RESPONSE_TYPE, AUTH_ERROR_TEXT } from './constants.js'; | ||
import { AuthErrorCode } from './types.js'; | ||
import { AuthStatsFlowSource, AuthErrorCode } from './types.js'; | ||
@@ -24,2 +25,3 @@ const CODE_CHALLENGE_METHOD = 's256'; | ||
interval; | ||
id = uuid(); | ||
close = ()=>{ | ||
@@ -110,4 +112,4 @@ this.opener && this.opener.close(); | ||
stats_info: encodeStatsInfo({ | ||
flow_source: params?.statsFlowSource, | ||
session_id: params?.uniqueSessionId | ||
flow_source: params?.statsFlowSource || AuthStatsFlowSource.AUTH, | ||
session_id: params?.uniqueSessionId || this.id | ||
}) | ||
@@ -114,0 +116,0 @@ }; |
var AuthStatsFlowSource; | ||
(function(AuthStatsFlowSource) { | ||
AuthStatsFlowSource["AUTH"] = 'from_custom_auth'; | ||
AuthStatsFlowSource["BUTTON_ONE_TAP"] = 'from_one_tap'; | ||
@@ -4,0 +5,0 @@ AuthStatsFlowSource["FLOATING_ONE_TAP"] = 'from_floating_one_tap'; |
// @ts-ignore-next-line пробрасываем версию из package.json в rollup.config | ||
const VERSION = "2.0.0-alpha.2"; | ||
const VERSION = "2.0.0-alpha.3"; | ||
// @ts-ignore-next-line пробрасываем тип сборки из rollup.config | ||
@@ -4,0 +4,0 @@ const DOMAIN = 'vk.com'; |
@@ -0,1 +1,2 @@ | ||
import { VERSION } from '../../constants.js'; | ||
import { getStatsUrl, request } from '../../utils/request.js'; | ||
@@ -28,3 +29,4 @@ | ||
const params = { | ||
events: JSON.stringify(this.stackEvents) | ||
events: JSON.stringify(this.stackEvents), | ||
sak_version: VERSION | ||
}; | ||
@@ -31,0 +33,0 @@ this.stackEvents = []; |
@@ -21,4 +21,6 @@ import './../../lib/@vkontakte/vkjs/lib/es6/detections.js'; | ||
const getRedirectWithPayloadUrl = (payload, config)=>{ | ||
const redirectUrlFromConfig = config.get().redirectUrl; | ||
const containsQuery = redirectUrlFromConfig.includes('?'); | ||
const params = Object.keys(payload).map((key)=>encodeURIComponent(key) + '=' + encodeURIComponent(payload[key])).join('&'); | ||
return `${config.get().redirectUrl}?${params}`; | ||
return `${redirectUrlFromConfig}${containsQuery ? '&' : '?'}${params}`; | ||
}; | ||
@@ -25,0 +27,0 @@ const encodeStatsInfo = (params)=>{ |
@@ -12,2 +12,3 @@ import { Config } from "../core/config"; | ||
private interval; | ||
private readonly id; | ||
private readonly close; | ||
@@ -14,0 +15,0 @@ private readonly handleMessage; |
@@ -5,2 +5,3 @@ import { OAUTH2_CODE_TYPE } from "./constants"; | ||
export declare enum AuthStatsFlowSource { | ||
AUTH = "from_custom_auth", | ||
BUTTON_ONE_TAP = "from_one_tap", | ||
@@ -7,0 +8,0 @@ FLOATING_ONE_TAP = "from_floating_one_tap", |
{ | ||
"name": "@vkid/sdk", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"description": "VK ID Web SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist-sdk/cjs/index.js", |
@@ -29,3 +29,3 @@ <div align="center"> | ||
ℹ️ Версия VK ID SDK 2.0.0-alpha поддерживает авторизацию по протоколу [OAuth 2.1](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-10), а также способы входа через аккаунты Одноклассников и Mail.ru. Если вы хотите участвовать в тестировании этой версии SDK или узнать о ней подробнее, напишите нам на почту devsupport@corp.vk.com. | ||
ℹ️ Версия VK ID SDK 2.0.0-alpha.3 поддерживает авторизацию по протоколу [OAuth 2.1](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-10), а также способы входа через аккаунты Одноклассников и Mail.ru. Если вы хотите участвовать в тестировании этой версии SDK или узнать о ней подробнее, напишите нам на почту devsupport@corp.vk.com. | ||
@@ -61,3 +61,3 @@ --- | ||
```html | ||
<script src="https://unpkg.com/@vkid/sdk@2.0.0-alpha/dist-sdk/umd/index.js"></script> | ||
<script src="https://unpkg.com/@vkid/sdk@2.0.0-alpha.3/dist-sdk/umd/index.js"></script> | ||
``` | ||
@@ -64,0 +64,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1619442
12961