Skip to content

Commit

Permalink
Merge pull request #128 from Stremio/fb-login
Browse files Browse the repository at this point in the history
FbLogin method
  • Loading branch information
Ivo Georgiev authored Nov 8, 2019
2 parents 2fec6c8 + cebbb15 commit 25bfaf1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/state_types/models/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ impl<Env: Environment + 'static> Update for Ctx<Env> {
APIRequest::Login { email, password },
))
.unchanged(),
ActionUser::FbLogin { email, fb_login_token } => Effects::one(authenticate::<Env>(
action.to_owned(),
APIRequest::FbLogin { email, fb_login_token },
))
.unchanged(),
ActionUser::PullAndUpdateAddons => match &self.content.auth {
Some(Auth { key, .. }) => {
let action = action.to_owned();
Expand Down
1 change: 1 addition & 0 deletions src/state_types/msg/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub enum ActionSettings {
#[serde(tag = "userOp", content = "args")]
pub enum ActionUser {
Login { email: String, password: String },
FbLogin { email: String, fb_login_token: String },
Register { email: String, password: String, gdpr_consent: GDPRConsent },
Logout,
PullAndUpdateAddons,
Expand Down
6 changes: 6 additions & 0 deletions src/types/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ pub enum APIRequest {
email: String,
password: String,
},
#[serde(rename_all = "camelCase")]
FbLogin {
email: String,
fb_login_token: String,
},
Register {
email: String,
password: String,
Expand All @@ -61,6 +66,7 @@ impl APIMethodName for APIRequest {
fn method_name(&self) -> &str {
match self {
APIRequest::Login { .. } => "login",
APIRequest::FbLogin { .. } => "fbLogin",
APIRequest::Register { .. } => "register",
APIRequest::Logout { .. } => "logout",
APIRequest::AddonCollectionGet { .. } => "addonCollectionGet",
Expand Down

0 comments on commit 25bfaf1

Please sign in to comment.