-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is adding the ability of share oauth account information and delete them. - Adding email column to oauth_accounts table in order to facilitate users identify their accounts. - Updating GET /account/{id} to return oauth_providers containing OAuth information. - Adding new public endpoint DELETE /oauth/{provider} allowing user unlink OAuth accounts. - Adding new public endpoint GET /oauth/info returning oauth information for linked accounts. - Adding new private endpoint DELETE /account/{id}/oauth allowing unlink OAuth accounts for the given user. Fixes #252
- Loading branch information
1 parent
20fe8d8
commit 9c9929a
Showing
32 changed files
with
850 additions
and
69 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
package models | ||
|
||
import "time" | ||
import ( | ||
"encoding/json" | ||
"time" | ||
) | ||
|
||
type OauthAccount struct { | ||
ID int | ||
AccountID int `db:"account_id"` | ||
Provider string | ||
ProviderID string `db:"provider_id"` | ||
Email string `db:"email"` | ||
AccessToken string `db:"access_token"` | ||
CreatedAt time.Time `db:"created_at"` | ||
UpdatedAt time.Time `db:"updated_at"` | ||
} | ||
|
||
func (o OauthAccount) MarshalJSON() ([]byte, error) { | ||
return json.Marshal(struct { | ||
Provider string `json:"provider"` | ||
ProviderID string `json:"provider_account_id"` | ||
Email string `json:"email"` | ||
}{ | ||
Provider: o.Provider, | ||
ProviderID: o.ProviderID, | ||
Email: o.Email, | ||
}) | ||
} |
Oops, something went wrong.