I tried the following but it's not working. It's still using the default flash message.
class Users::SessionsController < Devise::SessionsController
after_action :custom_welcome, :only => [:create]
def custom_welcome
flash.notice = "Welcome back "+current_user.name+"." if flash.keys.include?(:notice)
end
end
Reference: https://github.com/plataformatec/devise#configuring-controllers
This worked.
flash.notice = "Welcome back #{current_user.name}." if flash.key?(:notice)