mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-03-19 15:01:06 +08:00
feat: Add callbackUrl and redirect as logout action params.
This commit is contained in:
parent
cf66fff46e
commit
9c13bd65df
@ -37,7 +37,7 @@ function getCallbackUrl({ lowdefy, callbackUrl = {} }) {
|
||||
function createAuthMethods({ lowdefy, auth }) {
|
||||
// login and logout are Lowdefy function that handle action params
|
||||
// signIn and signOut are the next-auth methods
|
||||
function login({ providerId, callbackUrl, authUrl = {} } = {}) {
|
||||
function login({ authUrl, callbackUrl, providerId } = {}) {
|
||||
if (type.isNone(providerId) && auth.authConfig.providers.length === 1) {
|
||||
providerId = auth.authConfig.providers[0].id;
|
||||
}
|
||||
@ -45,12 +45,11 @@ function createAuthMethods({ lowdefy, auth }) {
|
||||
auth.signIn(
|
||||
providerId,
|
||||
{ callbackUrl: getCallbackUrl({ lowdefy, callbackUrl }) },
|
||||
authUrl.urlQuery
|
||||
authUrl?.urlQuery
|
||||
);
|
||||
}
|
||||
// TODO: fix callbackUrl
|
||||
function logout() {
|
||||
auth.signOut();
|
||||
function logout({ callbackUrl, redirect } = {}) {
|
||||
auth.signOut({ callbackUrl: getCallbackUrl({ lowdefy, callbackUrl }), redirect });
|
||||
}
|
||||
return {
|
||||
login,
|
||||
|
Loading…
x
Reference in New Issue
Block a user