|
|
@@ -37,15 +37,15 @@ type User struct { // User
|
|
|
}
|
|
|
|
|
|
type PageParams struct{
|
|
|
- HasError string
|
|
|
- Error string
|
|
|
+ NotificationType string
|
|
|
+ Notification string
|
|
|
ReqDir string
|
|
|
Admin string
|
|
|
}
|
|
|
|
|
|
type PageUserParams struct{
|
|
|
- HasError string
|
|
|
- Error string
|
|
|
+ NotificationType string
|
|
|
+ Notification string
|
|
|
ReqDir string
|
|
|
Username string
|
|
|
Admin string
|
|
|
@@ -53,8 +53,8 @@ type PageUserParams struct{
|
|
|
}
|
|
|
|
|
|
type PageUserParamsMessage struct{
|
|
|
- HasError string
|
|
|
- Error string
|
|
|
+ NotificationType string
|
|
|
+ Notification string
|
|
|
ReqDir string
|
|
|
Username string
|
|
|
Email string
|
|
|
@@ -206,6 +206,7 @@ func AuthHandler(ctx *iris.Context) {
|
|
|
// fmt.Println("Auth error: ", err.Error())
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if isAuthed {
|
|
|
ctx.Next() // successfully authed, next handler
|
|
|
} else {
|
|
|
@@ -401,4 +402,15 @@ func UserUpdateProcessor(username string, password string, userID string) error
|
|
|
}
|
|
|
|
|
|
return nil
|
|
|
+}
|
|
|
+
|
|
|
+func IsTokenUsed(tokens []string, token string) bool {
|
|
|
+ usedToken := false
|
|
|
+ for i, _ := range tokens {
|
|
|
+ if token == tokens[i] {
|
|
|
+ usedToken = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return usedToken
|
|
|
}
|