Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payload Admin Sign-In #7

Closed
Jelly-exe opened this issue Nov 25, 2024 · 2 comments
Closed

Payload Admin Sign-In #7

Jelly-exe opened this issue Nov 25, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Jelly-exe
Copy link

Couple questions,

I'm using this plugin to do OAuth sign in for the admin panel, I only want users with existing admin accounts to be able to use the OAuth to login. (Created by another admin manually)

  • Is there a way to restrict it to only signing in for existing accounts?
  • Is there a way to manually create a link, or to specify that an account with Id equal to the oauth account id will link.
  • Is there a way to edit the sign in button, ideally, I'd like it to just be Sign in with <service>
@CrawlerCode
Copy link
Owner

Is there a way to restrict it to only signing in for existing accounts?

I am not currently aware of a suitable way to implement this.
You could restrict access with the SignIn callback, but you can't check if the user exists or not. There is currently an open issue on authjs/next-auth that focus your problem.


Is there a way to manually create a link, or to specify that an account with Id equal to the oauth account id will link.

Could you clarify your question or give an example?
You could create a database entry (user, account or whatever) directly via the payload api.


Is there a way to edit the sign in button, ideally, I'd like it to just be Sign in with

This is not possible at the moment. I will add the customization in the future.

@CrawlerCode CrawlerCode added the question Further information is requested label Nov 25, 2024
@CrawlerCode
Copy link
Owner

By the way, I have added the option to change the text of the sign in button:

authjsPlugin({
  authjsConfig: authConfig,
  // Customize the sign-in button text
  components: {
    SignInButton: {
      text: "Sign in with <service>",
    },
  },
})

Repository owner locked and limited conversation to collaborators Jan 28, 2025
@CrawlerCode CrawlerCode converted this issue into discussion #10 Jan 28, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants