summaryrefslogtreecommitdiffstats
path: root/plugin/hooks.go
diff options
context:
space:
mode:
authorDaniel Schalla <daniel@schalla.me>2018-07-30 20:55:38 +0200
committerChristopher Speller <crspeller@gmail.com>2018-07-30 11:55:38 -0700
commitd23ca07133e9bc5eed14d87af563471b4ef963cd (patch)
treeae01bb8f09600110c22a5f881be24e8d6f204986 /plugin/hooks.go
parent08e54ed8244e2ec9a278d16f80d5ed2a8e2964f4 (diff)
downloadchat-d23ca07133e9bc5eed14d87af563471b4ef963cd.tar.gz
chat-d23ca07133e9bc5eed14d87af563471b4ef963cd.tar.bz2
chat-d23ca07133e9bc5eed14d87af563471b4ef963cd.zip
Login Hooks (#9177)
Tests; gofmt
Diffstat (limited to 'plugin/hooks.go')
-rw-r--r--plugin/hooks.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugin/hooks.go b/plugin/hooks.go
index c191652e3..363a69fc0 100644
--- a/plugin/hooks.go
+++ b/plugin/hooks.go
@@ -30,6 +30,8 @@ const (
UserHasLeftTeamId = 12
ChannelHasBeenCreatedId = 13
FileWillBeUploadedId = 14
+ UserWillLogInId = 15
+ UserHasLoggedInId = 16
TotalHooksId = iota
)
@@ -119,6 +121,13 @@ type Hooks interface {
// If actor is not nil, the user was removed from the team by the actor.
UserHasLeftTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
+ // UserWillLogIn before the login of the user is returned. Returning a non empty string will reject the login event.
+ // If you don't need to reject the login event, see UserHasLoggedIn
+ UserWillLogIn(c *Context, user *model.User) string
+
+ // UserHasLoggedIn is invoked after a user has logged in.
+ UserHasLoggedIn(c *Context, user *model.User)
+
// FileWillBeUploaded is invoked when a file is uploaded, but before it is committed to backing store.
// Read from file to retrieve the body of the uploaded file. You may modify the body of the file by writing to output.
// Returned FileInfo will be used instead of input FileInfo. Return nil to reject the file upload and include a text reason as the second argument.