Home platformOS Logo

Signing In a User Automatically after Sign-Up

Last edit: Apr 15, 2020

This guide will help you add automatic sign in to a sign-up form so that a new user will be logged in right after account creation.


This tutorial assumes that you already have a working sign up form, where a user can create a new account.


Automatic sign in after sign up is a three-step process:

Step 1: Add callback_actions key to Sign up form

In your sign_up form configuration add callback_actions at the end (order doesn't matter) of the YML definition.


callback_actions: "{% graphql res = 'user_session_create', email: form.email, password: form.password %}"

This code snippet executes the user_session_create query, so you have to create it.

Step 2: Create user_session_create GraphQL mutation

This mutation takes two obligatory arguments: email and password – both strings.

mutation user_session_create($email: String!, $password: String!) {
    form_name: "session_create_form" # must match with `name` of your form
    email: $email
    password: $password
  ) {

This calls the session_create_form with the same arguments you received from the callback_actions.

Step 3: Create session_create_form form

SessionForm is supported by the server, so you don't need to define anything – the server will take care of handling user credentials and authenticating the user.

name: session_create_form
resource: Session

Next steps

Congratulations! You have set up automatic user login after sign up. You can now learn about logging out the user:

Contribute to this page

Github Icon


We are always happy to help with any questions you may have.

contact us