Skip to content

Commit

Permalink
Added script for updating user records
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith committed Mar 6, 2024
1 parent 536c727 commit 51e775a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/tasks/update_users_sso.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'rake'

namespace :gwss do
# To be used for migrating user records for GW users that do not
desc "Updates user records for use with SSO"

task :update_users_sso => :environment do
# Regex to match GW email address patterns
gw_email = /@((gwmail|email).)*gwu.edu/
User.find_each do |user|
if gw_email.match(user.email)
user.uid = user.email
user.provider = "saml"
user.save
end
end
end
end

0 comments on commit 51e775a

Please sign in to comment.