Skip to content

Support for OAuth Logins ? #220

@Jan0707

Description

@Jan0707

Hi 👋

Our directus instance currently only supports login via OAuth (e.g. github).

We would like to use this package, but it seems like you only support login via username/password (e.g. see documentation here: https://nuxt-directus-docs.vercel.app/composables/usedirectusauth#login )

Our current workaround is to manually include a "Login via XYZ" button in the nuxt frontend and have that then again redirect to the nuxt website once, the login/auth flow has completed.

However, when I then try to access the user:

const { fetchUser, setUser } = useDirectusAuth();
let user = useDirectusUser();
if (!user.value) {
  const user = await fetchUser();
  console.log("Fetched User", user);
  setUser(user.value);
}

I only ever get undefined.

Am I missing something or is the whole user composable simply not fit to support this use case?

Any hint would be highly appreciated 🙏

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions