Skip to content

Commit 3e7fa92

Browse files
author
Daman Arora
committed
Add domainId support to OAuth provider
1 parent 9ab26db commit 3e7fa92

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

ui/src/config/section/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export default {
7979
icon: 'login-outlined',
8080
docHelp: 'adminguide/accounts.html#using-an-ldap-server-for-user-authentication',
8181
permission: ['listOauthProvider'],
82-
columns: ['provider', 'enabled', 'description', 'clientid', 'secretkey', 'redirecturi'],
83-
details: ['provider', 'description', 'enabled', 'clientid', 'secretkey', 'redirecturi'],
82+
columns: ['provider', 'enabled', 'description', 'clientid', 'secretkey', 'redirecturi', 'domainid'],
83+
details: ['provider', 'description', 'enabled', 'clientid', 'secretkey', 'redirecturi', 'domainid'],
8484
actions: [
8585
{
8686
api: 'registerOauthProvider',
@@ -89,7 +89,7 @@ export default {
8989
listView: true,
9090
dataView: false,
9191
args: [
92-
'provider', 'description', 'clientid', 'redirecturi', 'secretkey'
92+
'provider', 'description', 'clientid', 'redirecturi', 'secretkey', 'domainid'
9393
],
9494
mapping: {
9595
provider: {

ui/src/views/auth/Login.vue

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,18 @@ export default {
311311
this.form.idp = this.idps[0].id || ''
312312
}
313313
})
314+
this.fetchOauthProviders()
315+
postAPI('forgotPassword', {}).then(response => {
316+
this.forgotPasswordEnabled = response.forgotpasswordresponse.enabled
317+
}).catch((err) => {
318+
if (err?.response?.data === null) {
319+
this.forgotPasswordEnabled = true
320+
} else {
321+
this.forgotPasswordEnabled = false
322+
}
323+
})
324+
},
325+
fetchOauthProviders () {
314326
getAPI('listOauthProvider', {}).then(response => {
315327
if (response) {
316328
const oauthproviders = response.listoauthproviderresponse.oauthprovider || []
@@ -329,15 +341,6 @@ export default {
329341
this.socialLogin = this.googleprovider || this.githubprovider
330342
}
331343
})
332-
postAPI('forgotPassword', {}).then(response => {
333-
this.forgotPasswordEnabled = response.forgotpasswordresponse.enabled
334-
}).catch((err) => {
335-
if (err?.response?.data === null) {
336-
this.forgotPasswordEnabled = true
337-
} else {
338-
this.forgotPasswordEnabled = false
339-
}
340-
})
341344
},
342345
// handler
343346
async handleUsernameOrEmail (rule, value) {

ui/src/views/dashboard/VerifyOauth.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747
const code = params.get('code')
4848
const provider = this.$localStorage.get(OAUTH_PROVIDER)
4949
this.state.loginBtn = true
50-
getAPI('verifyOAuthCodeAndGetUser', { provider: provider, secretcode: code }).then(response => {
50+
getAPI('verifyOAuthCodeAndGetUser', { provider: provider, secretcode: code, domain: this.$localStorage.get(OAUTH_DOMAIN) }).then(response => {
5151
const email = response.verifyoauthcodeandgetuserresponse.oauthemail.email
5252
const loginParams = {}
5353
loginParams.email = email

0 commit comments

Comments
 (0)