-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix: Improve Google OAuth login flow.
- Loading branch information
Showing
5 changed files
with
247 additions
and
5 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
34 changes: 34 additions & 0 deletions
34
flows-google/src/main/java/io/hanbings/flows/google/GoogleIdentify.java
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,34 @@ | ||
package io.hanbings.flows.google; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
import io.hanbings.flows.common.interfaces.Identify; | ||
|
||
public record GoogleIdentify( | ||
@JsonProperty("sub") | ||
@SerializedName("sub") | ||
String openid, | ||
@JsonProperty("picture") | ||
@SerializedName("picture") | ||
String avatar, | ||
@JsonProperty("name") | ||
@SerializedName("name") | ||
String username, | ||
@JsonProperty("username") | ||
@SerializedName("username") | ||
String nickname, | ||
@JsonProperty("email") | ||
@SerializedName("email") | ||
String email, | ||
String phone | ||
) implements Identify { | ||
public record Wrong( | ||
@JsonProperty("error") | ||
@SerializedName("error") | ||
String error, | ||
@JsonProperty("error_description") | ||
@SerializedName("error_description") | ||
String errorDescription | ||
) implements Identify.Wrong { | ||
} | ||
} |
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
39 changes: 39 additions & 0 deletions
39
flows-google/src/main/java/io/hanbings/flows/google/GoogleProfile.java
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,39 @@ | ||
package io.hanbings.flows.google; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
import io.hanbings.flows.common.interfaces.Profile; | ||
|
||
public record GoogleProfile( | ||
@JsonProperty("sub") | ||
@SerializedName("sub") | ||
String sub, | ||
@JsonProperty("name") | ||
@SerializedName("name") | ||
String name, | ||
@JsonProperty("given_name") | ||
@SerializedName("given_name") | ||
String givenName, | ||
@JsonProperty("family_name") | ||
@SerializedName("family_name") | ||
String familyName, | ||
@JsonProperty("picture") | ||
@SerializedName("picture") | ||
String picture, | ||
@JsonProperty("email") | ||
@SerializedName("email") | ||
String email, | ||
@JsonProperty("locale") | ||
@SerializedName("locale") | ||
String locale | ||
) implements Profile { | ||
public record Wrong( | ||
@JsonProperty("error") | ||
@SerializedName("error") | ||
String error, | ||
@JsonProperty("error_description") | ||
@SerializedName("error_description") | ||
String errorDescription | ||
) implements Profile.Wrong { | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
flows-google/src/main/java/io/hanbings/flows/google/GoogleRevoke.java
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,17 @@ | ||
package io.hanbings.flows.google; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
import io.hanbings.flows.common.interfaces.Revoke; | ||
|
||
public record GoogleRevoke() implements Revoke { | ||
public record Wrong( | ||
@JsonProperty("error") | ||
@SerializedName("error") | ||
String error, | ||
@JsonProperty("error_description") | ||
@SerializedName("error_description") | ||
String errorDescription | ||
) implements Revoke.Wrong { | ||
} | ||
} |