Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Payload Admin Sign-In #10

Unanswered
Jelly-exe asked this question in Q&A
Discussion options

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>
You must be logged in to vote

Replies: 2 comments

Comment options

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.

You must be logged in to vote
0 replies
Comment options

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>",
 },
 },
})
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #7 on January 28, 2025 18:15.

AltStyle によって変換されたページ (->オリジナル) /