You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/app/controllers/access_tokens_controller.rb

16 lines
385 B

class AccessTokensController < ApplicationController
# Skip authentication for this method
skip_before_action :authenticate_user!, only: [:public_by_email]
def public_by_email
user = User.find_by!(email: params[:email])
access_token = user.access_token
render json: {
user_id: user.id,
email: user.email,
token: access_token.token
}
end
end