forked from eatvio/eatvio_app
feat(diary): added navigation to detailed diet screen form diary
This commit is contained in:
@@ -27,7 +27,7 @@ class SocialAuthFacade {
|
||||
|
||||
try {
|
||||
final controller = VkIDController(clID: int.parse(clientIdStr));
|
||||
final authUri = controller.generateAuthorizeLinkWithCodeVerifier();
|
||||
final authUri = controller.generateAuthorizeLinkWithCodeVerifier(scopes: [VkScope.phone, VkScope.email, VkScope.personalInfo]);
|
||||
|
||||
final authUrl = authUri.value.toString();
|
||||
final codeVerifier = authUri.key;
|
||||
@@ -76,7 +76,16 @@ class SocialAuthFacade {
|
||||
log(msg);
|
||||
return null;
|
||||
}
|
||||
final response = await http.get(Uri.parse('https://id.vk.com/openapi/v1/phone_number'), headers: {'Authorization': 'Bearer ${auth.accessToken}'});
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final json = jsonDecode(response.body);
|
||||
final phone = json['phone_number'];
|
||||
log(json.toString());
|
||||
log('Phone: $phone');
|
||||
} else {
|
||||
log('VK phone request failed: ${response.statusCode} ${response.body}');
|
||||
}
|
||||
return AuthResultEntity(
|
||||
accessToken: auth.accessToken,
|
||||
refreshToken: auth.refreshToken,
|
||||
@@ -204,7 +213,7 @@ class SocialAuthFacade {
|
||||
try {
|
||||
final controller = VkIDController(clID: int.parse(clientIdStr));
|
||||
|
||||
final authUri = controller.generateAuthorizeLinkWithCodeVerifier(provider: provider);
|
||||
final authUri = controller.generateAuthorizeLinkWithCodeVerifier(provider: provider, scopes: [VkScope.phone, VkScope.email, VkScope.personalInfo]);
|
||||
final codeVerifier = authUri.key;
|
||||
final authUrl = authUri.value.toString();
|
||||
final redirectScheme = 'vk$clientIdStr://';
|
||||
|
||||
Reference in New Issue
Block a user