0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-04-14 23:11:31 -05:00

fix(ui): fix social bug ()

* fix(ui): fix social bug

fix social bug

* fix(ui): align social bind account api path

align social bind account api path
This commit is contained in:
simeng-li 2022-05-24 20:48:12 +08:00 committed by GitHub
parent 8060ec4941
commit 7a17d41acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions
packages/ui/src

View file

@ -71,7 +71,7 @@ describe('api', () => {
password,
},
});
expect(ky.post).toHaveBeenNthCalledWith(2, '/api/session/sign-in/bind-social', {
expect(ky.post).toHaveBeenNthCalledWith(2, '/api/session/bind-social', {
json: {
connectorId: 'github',
},
@ -204,7 +204,7 @@ describe('api', () => {
it('bindSocialAccount', async () => {
await bindSocialAccount('connectorId');
expect(ky.post).toBeCalledWith('/api/session/sign-in/bind-social', {
expect(ky.post).toBeCalledWith('/api/session/bind-social', {
json: {
connectorId: 'connectorId',
},

View file

@ -37,17 +37,13 @@ export const signInWithSocial = async (parameters: {
};
export const bindSocialAccount = async (connectorId: string) => {
type Response = {
redirectTo: string;
};
return api
.post('/api/session/sign-in/bind-social', {
.post('/api/session/bind-social', {
json: {
connectorId,
},
})
.json<Response>();
.json();
};
export const bindSocialRelatedUser = async (connectorId: string) => {

View file

@ -70,7 +70,7 @@ const useSocial = () => {
// Invoke Native Social Sign In flow
if (isNativeWebview()) {
getLogtoNativeSdk()?.getPostMessage()({
callbackUri: `${origin}/callback/${connectorId}`,
callbackUri: `${origin}/sign-in/callback/${connectorId}`,
redirectTo: result.redirectTo,
});