Skip to content

Commit

Permalink
Support Google login (two-factor auth) (smogon#999)
Browse files Browse the repository at this point in the history
This doesn't support setting accounts up for Google login: that still
has to be manually done via the database by setting the email field to
`[email protected]@`, where the second `@` denotes that it's using
Gmail login.

If the email field does end in `@`, `getassertion` will note this by
sending `;;@gmail`, to convey that the server is expecting a Google
login token rather than a password.

Upon receiving `;;@gmail`, the client will replace the password box will
with a Google login button, and then send the resulting Google login
token to the server in the `password` field. The server will validate
the "password" using the Google server libraries, and otherwise handle
the login as normal.

Note that Google login requires various features that a paranoid person
might disable; most notably 3rd-party cookies.

Fixes smogon/pokemon-showdown#3394
  • Loading branch information
Zarel authored Sep 13, 2017
1 parent 92f8103 commit 644d5cc
Show file tree
Hide file tree
Showing 7 changed files with 771 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ eslint-cache/
.DS_Store
Thumbs.db
npm-debug.log
/vendor/
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"google/apiclient": "^2.2"
}
}
Loading

0 comments on commit 644d5cc

Please sign in to comment.