Skip to content

Commit 08e4468

Browse files
committed
Code formatted
1 parent 8b583df commit 08e4468

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

example/controllers/authController.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ package controllers
33
import (
44
"github.com/gin-gonic/gin"
55
"github.com/gin-gonic/gin/binding"
6-
goOauth2 "github.com/gobeam/golang-oauth"
6+
oauth2 "github.com/gobeam/golang-oauth"
77
"github.com/gobeam/golang-oauth/example/core/models"
88
"github.com/gobeam/golang-oauth/example/shared/passhash"
99
"net/http"
1010
)
1111

1212
type AuthController struct {
13-
store *goOauth2.Store
13+
store *oauth2.Store
1414
Controller
1515
}
1616

17-
func NewAuthController(store *goOauth2.Store) *AuthController {
17+
func NewAuthController(store *oauth2.Store) *AuthController {
1818
return &AuthController{store: store}
1919
}
2020

example/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55
_ "github.com/go-sql-driver/mysql"
6-
goOauth2 "github.com/gobeam/golang-oauth"
6+
oauth2 "github.com/gobeam/golang-oauth"
77
"github.com/gobeam/golang-oauth/example/common"
88
"github.com/gobeam/golang-oauth/example/core/models"
99
"github.com/gobeam/golang-oauth/example/routers"
@@ -18,8 +18,8 @@ func main() {
1818
panic(err)
1919
}
2020
defer db.Close()
21-
store := goOauth2.NewDefaultStore(
22-
goOauth2.NewConfig(dbUrl),
21+
store := oauth2.NewDefaultStore(
22+
oauth2.NewConfig(dbUrl),
2323
)
2424
defer store.Close()
2525
models.InitializeDb(db.Debug())

example/middlewares/oauthMiddleware.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package middleware
33
import (
44
"github.com/gin-gonic/gin"
55
"github.com/gin-gonic/gin/binding"
6-
goOauth2 "github.com/gobeam/golang-oauth"
6+
oauth2 "github.com/gobeam/golang-oauth"
77
"github.com/gobeam/golang-oauth/example/core/models"
88
"github.com/gobeam/golang-oauth/example/shared/passhash"
99
"github.com/gobeam/golang-oauth/model"
@@ -98,7 +98,7 @@ func findInSlice(slice []string, val string) bool {
9898

9999

100100
// Check If access token is valid and have proper scope
101-
func OauthMiddleware(store *goOauth2.Store) gin.HandlerFunc {
101+
func OauthMiddleware(store *oauth2.Store) gin.HandlerFunc {
102102
return func(c *gin.Context) {
103103
authHeader := c.Request.Header.Get("Authorization")
104104
if authHeader == "" {
@@ -155,7 +155,7 @@ func OauthMiddleware(store *goOauth2.Store) gin.HandlerFunc {
155155
}
156156

157157
// Return Access Token for valid client and user credential
158-
func AccessToken(store *goOauth2.Store) gin.HandlerFunc {
158+
func AccessToken(store *oauth2.Store) gin.HandlerFunc {
159159
return func(c *gin.Context) {
160160
var grant GrantType
161161
if err := c.ShouldBindBodyWith(&grant, binding.JSON); err != nil {

example/routers/routers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package routers
22

33
import (
44
"github.com/gin-gonic/gin"
5-
goOauth2 "github.com/gobeam/golang-oauth"
5+
oauth2 "github.com/gobeam/golang-oauth"
66
"github.com/gobeam/golang-oauth/example/controllers"
77
"github.com/gobeam/golang-oauth/example/middlewares"
88
)
@@ -21,7 +21,7 @@ func ResourceFulRouter(r gin.IRouter, controller controllers.ResourceController)
2121
r.DELETE("/:id", controller.Destroy)
2222
}
2323

24-
func SetupRouter(store *goOauth2.Store) *gin.Engine {
24+
func SetupRouter(store *oauth2.Store) *gin.Engine {
2525
router := gin.Default()
2626
router.Use(middleware.CORS())
2727
authController := controllers.NewAuthController(store)

0 commit comments

Comments
 (0)