how do i obtain token during signup?
See original GitHub issueWhen user signs up then how do i obtain the token for that user so i can login automatically just after successful signup.
Here is my registration code
class Register(graphene.Mutation):
class Arguments:
email = graphene.String(required=True)
password = graphene.String(required=True)
password_repeat = graphene.String(required=True)
user = graphene.Field(UserQuery)
token = graphene.String()
success = graphene.Boolean()
errors = graphene.List(graphene.String)
@staticmethod
def mutate(self, info, email, password, password_repeat):
if password == password_repeat:
try:
user = User.objects.create(email=email)
user.set_password(password)
user.is_active = False
user.full_clean()
user.save()
# i need to pass token as well
return Register(success=True, user=user)
except ValidationError as e:
return Register(success=False, errors=[e])
return Register(success=False, errors=['password', 'password is not matching'])
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Get Access Tokens - Auth0
Learn how to request Access Tokens using the Authorize endpoint when authenticating users and include the target audience and scope of access requested...
Read more >How to mint and use initial tokens for client registration
Step 2. Obtain the required initial registration token(s) ... Make a call at the direct authorisation endpoint to obtain the actual initial token...
Read more >How to get an access token with Auth Code Grant | DocuSign
To get a new access token, use the refresh token as you would an authorization code, but with a grant_type value of refresh_token...
Read more >Get access token during Auth Registration Handler(Auth ...
As far as I know we can get access token by using Auth.AuthToken.getAccessToken, but this user context and Auth.RegistrationHandler runs is ...
Read more >Using the token model | Authorization - Google Developers
Find or create a client ID by following the steps described in the Get your Google API client ID guide. Next, add the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @SanskarSans ,
I close the issue, if you have any questions please let me know.
@mongkok how would this be achieved if one has opted for the JWT stored in cookie approach?