Skip to content

Commit b7f2cb2

Browse files
authored
Added ID method, logout --> Sign out (#7)
1 parent 63b1a95 commit b7f2cb2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

common/ids.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package common
2+
3+
import (
4+
"fmt"
5+
"github.com/google/uuid"
6+
"strings"
7+
)
8+
9+
func CreateID(prefix string) string {
10+
str := uuid.New().String()
11+
str = strings.ReplaceAll(str, "-", "")
12+
return fmt.Sprintf("%s_%s", prefix, str)
13+
}

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func main() {
6464
{
6565
userAPI.POST("/signin", userHandlers.SignIn)
6666
userAPI.POST("/signup", userHandlers.SignUp)
67-
userAPI.POST("/logout", auth.ValidateAuth(userRepository), userHandlers.LogOut)
67+
userAPI.POST("/signout", auth.ValidateAuth(userRepository), userHandlers.LogOut)
6868
userAPI.POST("/session/unlock", userHandlers.UnlockSession)
6969
userAPI.POST("/forgot-password/", userHandlers.SendForgotPassword)
7070
userAPI.POST("/forgot-password/reset", userHandlers.ForgotPassword)

0 commit comments

Comments
 (0)