mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: Add Invitation Code to Generate Invitation Link (#2666)
Add auto-population of invitation fields in the registration page based on the invitation code in the link
This commit is contained in:
@ -34,6 +34,16 @@ export function getInvitation(owner, name) {
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getInvitationCodeInfo(code, applicationName) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-invitation-info?code=${code}&applicationId=${encodeURIComponent(applicationName)}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function updateInvitation(owner, name, invitation) {
|
||||
const newInvitation = Setting.deepCopy(invitation);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-invitation?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
|
Reference in New Issue
Block a user