feat: metamask login
This commit is contained in:
+8
-5
@@ -1,10 +1,13 @@
|
||||
// const BASE_URL = `${location.origin}/api`;
|
||||
const BASE_URL = `http://rustchat.com:3000/api`;
|
||||
const BASE_URL = `https://rustchat.com:3000/api`;
|
||||
export const ContentTypes = {
|
||||
text: "text/plain",
|
||||
image: "image/png",
|
||||
json: "application/json",
|
||||
text: 'text/plain',
|
||||
image: 'image/png',
|
||||
json: 'application/json'
|
||||
};
|
||||
export const tokenHeader = "X-API-Key";
|
||||
export const googleClientID =
|
||||
'418687074928-naojba82n9ktf0rkvnqoor4nhr54ql1b.apps.googleusercontent.com';
|
||||
// "840319286941-6ds7lbvk55eq8mjortf68cb2ll65lprt.apps.googleusercontent.com";
|
||||
export const tokenHeader = 'X-API-Key';
|
||||
|
||||
export default BASE_URL;
|
||||
|
||||
@@ -25,10 +25,20 @@ export const authApi = createApi({
|
||||
body: { magic_token: token }
|
||||
})
|
||||
}),
|
||||
getMetamaskNonce: builder.query({
|
||||
query: (address) => ({
|
||||
url: `/token/metamask/nonce?public_address=${address}`
|
||||
})
|
||||
}),
|
||||
logout: builder.query({
|
||||
query: () => ({ url: `token/logout` })
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const { useLoginMutation, useLazyLogoutQuery, useCheckInviteTokenValidMutation } = authApi;
|
||||
export const {
|
||||
useLazyGetMetamaskNonceQuery,
|
||||
useLoginMutation,
|
||||
useLazyLogoutQuery,
|
||||
useCheckInviteTokenValidMutation
|
||||
} = authApi;
|
||||
|
||||
Reference in New Issue
Block a user