Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
20408159
Commit
20408159
authored
Feb 18, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add access restriction
parent
4f8dc0df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
app/controllers/users/omniauth_callbacks_controller.rb
+9
-0
No files found.
app/controllers/users/omniauth_callbacks_controller.rb
View file @
20408159
class
Users
::
OmniauthCallbacksController
<
Devise
::
OmniauthCallbacksController
def
google_oauth2
email
=
request
.
env
[
'omniauth.auth'
].
info
[
'email'
]
# reject if email is not zigexn nor ventura
if
email
!~
/@zigexn\.co\.jp$/
&&
email
!~
/@zigexn\.vn$/
redirect_to
root_path
,
flash:
{
alert:
'Your email address is not permitted.'
}
return
end
# You need to implement the method below in your model (e.g. app/models/user.rb)
@user
=
User
.
find_for_google_oauth2
(
request
.
env
[
'omniauth.auth'
],
current_user
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment