mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
13 lines
391 B
Ruby
13 lines
391 B
Ruby
class UsersController < ApplicationController
|
|
skip_before_action :authenticate_request
|
|
|
|
def set_password_from_token
|
|
user = User.where(invitation_token: params[:token]).first
|
|
|
|
if user
|
|
user.update(password: params[:password], invitation_token: nil, status: 'active')
|
|
else
|
|
render json: { message: 'Invalid Invitation Token' }, status: :bad_request
|
|
end
|
|
end
|
|
end
|