@ecomplus/storefront-components 1.0.0-beta.177 → 1.0.0-beta.178
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.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/js/LoginBlock.js +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-beta.178](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.177...@ecomplus/storefront-components@1.0.0-beta.178) (2024-05-07)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **components/login-block:** handling custom oauth handlers from globals ([5147a19](https://github.com/ecomplus/storefront/commit/5147a190c5e089ce1702b330b7a4cec788739ff2))
|
|
11
|
+
|
|
6
12
|
# [1.0.0-beta.177](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.176...@ecomplus/storefront-components@1.0.0-beta.177) (2024-05-02)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @ecomplus/storefront-components
|
package/package.json
CHANGED
package/src/js/LoginBlock.js
CHANGED
|
@@ -118,8 +118,12 @@ export default {
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
|
|
121
|
-
oauthPopup (
|
|
122
|
-
|
|
121
|
+
oauthPopup (fnOrLink) {
|
|
122
|
+
if (typeof fnOrLink === 'function') {
|
|
123
|
+
fnOrLink()
|
|
124
|
+
} else {
|
|
125
|
+
this.ecomPassport.popupOauthLink(fnOrLink)
|
|
126
|
+
}
|
|
123
127
|
this.isWaitingPopup = true
|
|
124
128
|
setTimeout(() => {
|
|
125
129
|
this.isWaitingPopup = false
|
|
@@ -138,6 +142,26 @@ export default {
|
|
|
138
142
|
},
|
|
139
143
|
|
|
140
144
|
created () {
|
|
145
|
+
if (Array.isArray(window.OAUTH_PROVIDERS)) {
|
|
146
|
+
this.oauthProviders = []
|
|
147
|
+
if (window.OAUTH_PROVIDERS.includes('google') && window.signInWithGoogle) {
|
|
148
|
+
this.oauthProviders.push({
|
|
149
|
+
link: window.signInWithGoogle,
|
|
150
|
+
faIcon: 'fa-google',
|
|
151
|
+
provider: 'google',
|
|
152
|
+
providerName: 'Google'
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
if (window.OAUTH_PROVIDERS.includes('facebook') && window.signInWithFacebook) {
|
|
156
|
+
this.oauthProviders.push({
|
|
157
|
+
link: window.signInWithFacebook,
|
|
158
|
+
faIcon: 'fa-facebook-f',
|
|
159
|
+
provider: 'facebook',
|
|
160
|
+
providerName: 'Facebook'
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
if (this.oauthProviders.length) return
|
|
164
|
+
}
|
|
141
165
|
if (!this.canFetchOauth) return
|
|
142
166
|
this.ecomPassport.fetchOauthProviders()
|
|
143
167
|
.then(({ host, baseUri, oauthPath, providers }) => {
|