mirror of
https://github.com/logto-io/logto.git
synced 2025-04-14 23:11:31 -05:00
fix(ui): fix social bug (#939)
* 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:
parent
8060ec4941
commit
7a17d41acf
3 changed files with 5 additions and 9 deletions
packages/ui/src
|
@ -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',
|
||||
},
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue