-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http utils and http post request call
- Loading branch information
1 parent
42b0cce
commit f078d4d
Showing
6 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# github/bhattaraibishal50/blog/user/repository | ||
user/repository/userRepp.go:4:2: imported and not used: "bytes" | ||
user/repository/userRepp.go:5:2: imported and not used: "net/http" | ||
user/repository/userRepp.go:6:2: imported and not used: "log" | ||
user/repository/userRepp.go:7:2: imported and not used: "encoding/json" | ||
note: module requires Go 1.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ type firebaseAuthRepo struct{} | |
var fb = common.NewFirebaseApp() | ||
var fbAuth = fb.GetFirebaseAuth() | ||
var ctx = context.Background() | ||
|
||
var serviceURI = "https://5000-c6fca9c0-4e36-41d2-86db-511a4134a8bf.ws-us02.gitpod.io/blog-goland/asia-northeast3/api" | ||
// NewFirebaseAuthRepo constrictore returns user repos | ||
func NewFirebaseAuthRepo() UserRepository { | ||
return &firebaseAuthRepo{} | ||
|
@@ -27,9 +27,13 @@ func NewFirebaseAuthRepo() UserRepository { | |
// If you want to sign in as a user, you need to use the Firebase Authentication SDK. | ||
func (*firebaseAuthRepo) Login() { | ||
// checks the user by email and the password | ||
|
||
|
||
// request body (payload) | ||
|
||
payload := map[string]interface{}{ | ||
"email" : "[email protected]", | ||
"password" : "password", | ||
} | ||
common.MakeHTTPRequestWithJSONPayload(payload, serviceURI) | ||
usersRecord, err := fbAuth.GetUser(ctx, "5ZamU26mXsOYmCrankcEGTujgsj2") | ||
if err != nil { | ||
fmt.Println(err) | ||
|
@@ -39,3 +43,4 @@ func (*firebaseAuthRepo) Login() { | |
|
||
|
||
// GO tokenization. | ||
|