Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
4e0ff484
Commit
4e0ff484
authored
8 years ago
by
Kyle Doherty
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
track auth events (#2941)
parent
6b646f79
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/auth/auth.js
+7
-0
7 additions, 0 deletions
frontend/src/metabase/auth/auth.js
with
7 additions
and
0 deletions
frontend/src/metabase/auth/auth.js
+
7
−
0
View file @
4e0ff484
...
...
@@ -3,6 +3,7 @@ import { handleActions, combineReducers, AngularResourceProxy, createThunkAction
import
MetabaseCookies
from
"
metabase/lib/cookies
"
;
import
MetabaseUtils
from
"
metabase/lib/utils
"
;
import
MetabaseAnalytics
from
"
metabase/lib/analytics
"
;
import
{
clearGoogleAuthCredentials
}
from
"
metabase/lib/auth
"
;
...
...
@@ -25,6 +26,7 @@ export const login = createThunkAction("AUTH_LOGIN", function(credentials, onCha
// since we succeeded, lets set the session cookie
MetabaseCookies
.
setSessionCookie
(
newSession
.
id
);
MetabaseAnalytics
.
trackEvent
(
'
Auth
'
,
'
Login
'
);
// TODO: redirect after login (carry user to intended destination)
// this is ridiculously stupid. we have to wait (300ms) for the cookie to actually be set in the browser :(
setTimeout
(()
=>
onChangeLocation
(
"
/
"
),
300
);
...
...
@@ -47,6 +49,8 @@ export const loginGoogle = createThunkAction("AUTH_LOGIN_GOOGLE", function(googl
// since we succeeded, lets set the session cookie
MetabaseCookies
.
setSessionCookie
(
newSession
.
id
);
MetabaseAnalytics
.
trackEvent
(
'
Auth
'
,
'
Google Auth Login
'
);
// TODO: redirect after login (carry user to intended destination)
// this is ridiculously stupid. we have to wait (300ms) for the cookie to actually be set in the browser :(
setTimeout
(()
=>
onChangeLocation
(
"
/
"
),
300
);
...
...
@@ -73,6 +77,7 @@ export const logout = createThunkAction("AUTH_LOGOUT", function(onChangeLocation
// actively delete the session
SessionApi
.
delete
({
'
session_id
'
:
sessionId
});
}
MetabaseAnalytics
.
trackEvent
(
'
Auth
'
,
'
Logout
'
);
setTimeout
(()
=>
onChangeLocation
(
"
/auth/login
"
),
300
);
};
...
...
@@ -97,6 +102,8 @@ export const passwordReset = createThunkAction("AUTH_PASSWORD_RESET", function(t
MetabaseCookies
.
setSessionCookie
(
result
.
session_id
);
}
MetabaseAnalytics
.
trackEvent
(
'
Auth
'
,
'
Password Reset
'
);
return
{
success
:
true
,
error
:
null
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment