@rp_st
Currently my graphql service is exposed at /graphql endpoioint. To protect this endpoint so that only authenticated users can send request, I am using supertokens verifysession function. Everything is working as expected.
But now I want to allow anonymous users to access the graphql endpoint. I would like to check for user in the resolver function instead:
Copy code
// CreateAccount is the resolver for the createAccount field.
func (r *mutationResolver) CreateAccount(ctx context.Context, input ent.CreateAccountInput) (*ent.Account, error) {
// TODO: extract userID from ctx
any suggestions?
r
rp_st
05/04/2023, 6:25 PM
hey @aV there is a sessionRequired option that you can pass to verifySession. Check that out.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).