Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auth config pass through #43

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "add auth config support",
"packageName": "@zhishuyun/hub",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion src/components/common/AuthPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineComponent({
},
computed: {
iframeUrl() {
return `${getBaseUrlAuth()}/auth/login?inviter_id=${this.inviterId}`;
return `${getBaseUrlAuth()}/auth/login?config=${JSON.stringify(this.$config.auth)}&inviter_id=${this.inviterId}`;
},
inviterId() {
// if forceInviterId is set, then use forceInviterId
Expand Down
40 changes: 40 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,45 @@ export default {
* Note: if the forceInviterId is set, there will be no distribution page in console except for the forced inviter.
*/
forceInviterId: undefined
},

/**
* The auth configuration.
*/
auth: {
/**
* The auth provider configuration.
*/
providers: {
/**
* The auth provider configuration for wechat.
*/
wechat: {
/**
* Enable wechat auth provider.
*/
enabled: true
},

/**
* The auth provider configuration for email.
*/
email: {
/**
* Enable email auth provider.
*/
enabled: true
},

/**
* The auth provider configuration for phone.
*/
phone: {
/**
* Enable phone auth provider.
*/
enabled: true
}
}
}
};